| 522 | } |
| 523 | |
| 524 | func (c *Config) valid() error { |
| 525 | if !nameRegexp.MatchString(c.Name) { |
| 526 | return fmt.Errorf("%w: service name: name should not be empty and should consist of alphanumerical characters, dashes and underscores", ErrConfigValidation) |
| 527 | } |
| 528 | if !semVerRegexp.MatchString(c.Version) { |
| 529 | return fmt.Errorf("%w: version: version should not be empty should match the SemVer format", ErrConfigValidation) |
| 530 | } |
| 531 | if c.QueueGroup != "" && !subjectRegexp.MatchString(c.QueueGroup) { |
| 532 | return fmt.Errorf("%w: queue group: invalid queue group name", ErrConfigValidation) |
| 533 | } |
| 534 | |
| 535 | return nil |
| 536 | } |
| 537 | |
| 538 | func (s *service) wrapConnectionEventCallbacks() { |
| 539 | s.m.Lock() |