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

Function checkConsumerName

jsm.go:588–596  ·  view source on GitHub ↗

Check that the consumer name is not empty and is valid (does not contain "." and " "). Additional consumer name validation is done in nats-server. Returns ErrConsumerNameRequired if consumer name is empty, ErrInvalidConsumerName is invalid, otherwise nil

(consumer string)

Source from the content-addressed store, hash-verified

586// Additional consumer name validation is done in nats-server.
587// Returns ErrConsumerNameRequired if consumer name is empty, ErrInvalidConsumerName is invalid, otherwise nil
588func checkConsumerName(consumer string) error {
589 if consumer == _EMPTY_ {
590 return ErrConsumerNameRequired
591 }
592 if strings.ContainsAny(consumer, ". ") {
593 return ErrInvalidConsumerName
594 }
595 return nil
596}
597
598// DeleteConsumer deletes a Consumer.
599func (js *js) DeleteConsumer(stream, consumer string, opts ...JSOpt) error {

Callers 5

subscribeMethod · 0.85
DurableFunction · 0.85
upsertConsumerMethod · 0.85
DeleteConsumerMethod · 0.85
ConsumerInfoMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected