// filterResourceType implement filter. Proxy cares "Service" and "ServiceList" type
filterResourceType implement filter. Proxy cares "Service" and "ServiceList" type
// filterResourceType implement filter . Proxy cares " Service " and " ServiceList " type
func filterResourceType(msg model.Message) []v1.Service {
	svcs := make([]v1.Service, 0)
	content, ok := msg.Content.([]byte)
	if !ok {
		return svcs
	}
	switch getReourceType(msg.GetResource()) {
	case constants.ResourceTypeService:
		s, err := handleServiceMessage(content)
		if err != nil {
			break
		}
		svcs = append(svcs, *s)
	case constants.ResourceTypeServiceList:
		ss, err := handleServiceMessageList(content)
		if err != nil {
			break
		}
		svcs = append(svcs, ss...)
	default:
		klog.Infof("[L4 Proxy] process other resource: %s", msg.Router.Resource)
	}
	return svcs
}
func filterResourceType ( msg model . Message ) [ ] v1 . Service { svcs := make ( [ ] v1 . Service , 0 ) content , ok := msg . Content . ( [ ] byte ) if ! ok { return svcs } switch getReourceType ( msg . GetResource ( ) ) { case constants . ResourceTypeService : s , err := handleServiceMessage ( content ) if err != nil { break } svcs = append ( svcs , * s ) case constants . ResourceTypeServiceList : ss , err := handleServiceMessageList ( content ) if err != nil { break } svcs = append ( svcs , ss ... ) default : klog . Infof ( " " , msg . Router . Resource ) } return svcs }
filterResourceType implement filter.
filterResourceType implement filter .