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

Method matchSubscriptionSubject

micro/service.go:619–633  ·  view source on GitHub ↗
(subj string)

Source from the content-addressed store, hash-verified

617}
618
619func (s *service) matchSubscriptionSubject(subj string) (*Endpoint, bool) {
620 s.m.Lock()
621 defer s.m.Unlock()
622 for _, verbSub := range s.verbSubs {
623 if verbSub.Subject == subj {
624 return nil, true
625 }
626 }
627 for _, e := range s.endpoints {
628 if matchEndpointSubject(e.Subject, subj) {
629 return e, true
630 }
631 }
632 return nil, false
633}
634
635func matchEndpointSubject(endpointSubject, literalSubject string) bool {
636 subjectTokens := strings.Split(literalSubject, ".")

Callers 1

Calls 1

matchEndpointSubjectFunction · 0.85

Tested by

no test coverage detected