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)
| 586 | // Additional consumer name validation is done in nats-server. |
| 587 | // Returns ErrConsumerNameRequired if consumer name is empty, ErrInvalidConsumerName is invalid, otherwise nil |
| 588 | func 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. |
| 599 | func (js *js) DeleteConsumer(stream, consumer string, opts ...JSOpt) error { |
no outgoing calls
no test coverage detected