config.go 250 B

1234567891011121314151617
  1. package producer
  2. import (
  3. "errors"
  4. )
  5. type Config struct {
  6. Hosts []string `yaml:"hosts"`
  7. }
  8. func (c Config) Invalidate() error {
  9. if len(c.Hosts) < 1 {
  10. return errors.New("at least one bootstrap server / host must be provided")
  11. }
  12. return nil
  13. }