(name string, handler Handler, opts ...EndpointOpt)
| 843 | } |
| 844 | |
| 845 | func (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 | |
| 865 | func resolveQueueGroup(customQG, parentQG string, disabled, parentDisabled bool) (string, bool) { |
| 866 | if disabled { |
nothing calls this directly
no test coverage detected