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

Method AddEndpoint

micro/service.go:845–863  ·  view source on GitHub ↗
(name string, handler Handler, opts ...EndpointOpt)

Source from the content-addressed store, hash-verified

843}
844
845func (g *group) AddEndpoint(name string, handler Handler, opts ...EndpointOpt) error {
846 var options endpointOpts
847 for _, opt := range opts {
848 if err := opt(&options); err != nil {
849 return err
850 }
851 }
852 subject := name
853 if options.subject != "" {
854 subject = options.subject
855 }
856 endpointSubject := fmt.Sprintf("%s.%s", g.prefix, subject)
857 if g.prefix == "" {
858 endpointSubject = subject
859 }
860 queueGroup, noQueue := resolveQueueGroup(options.queueGroup, g.queueGroup, options.qgDisabled, g.queueGroupDisabled)
861
862 return addEndpoint(g.service, name, endpointSubject, handler, options.metadata, queueGroup, noQueue, options.msgLimit, options.bytesLimit)
863}
864
865func resolveQueueGroup(customQG, parentQG string, disabled, parentDisabled bool) (string, bool) {
866 if disabled {

Callers

nothing calls this directly

Calls 2

resolveQueueGroupFunction · 0.85
addEndpointFunction · 0.85

Tested by

no test coverage detected