MCPcopy
hub / github.com/nats-io/nats.go / matchEndpointSubject

Function matchEndpointSubject

micro/service.go:635–650  ·  view source on GitHub ↗
(endpointSubject, literalSubject string)

Source from the content-addressed store, hash-verified

633}
634
635func matchEndpointSubject(endpointSubject, literalSubject string) bool {
636 subjectTokens := strings.Split(literalSubject, ".")
637 endpointTokens := strings.Split(endpointSubject, ".")
638 if len(endpointTokens) > len(subjectTokens) {
639 return false
640 }
641 for i, et := range endpointTokens {
642 if i == len(endpointTokens)-1 && et == ">" {
643 return true
644 }
645 if et != subjectTokens[i] && et != "*" {
646 return false
647 }
648 }
649 return true
650}
651
652// addVerbHandlers generates control handlers for a specific verb.
653// Each request generates 3 subscriptions, one for the general verb

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected