config.go 242 B

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