Exemple #1
0
func (a *AmqpConfig) CheckRequired() error {
	errors := make(errorMap)
	if a.Channels == nil || len(*a.Channels) == 0 {
		errors.missing("channels")
	} else {
		for _, c := range *a.Channels {
			c.CheckRequired(errors)
		}
	}
	if len(errors) > 0 {
		return errorFor(errors)
	}

	return nil
}
Exemple #2
0
/*
CheckRequired ...
*/
func (s *Settings) CheckRequired() error {
	errors := make(errorMap)
	if s.AmqpInput == nil {
		errors.missing("amqpinput")
		return errorFor(errors)
	}

	inputErrors := s.AmqpInput.CheckRequired()
	if inputErrors != nil {
		e := inputErrors.(*ConfigError)
		for k, v := range e.ErrorMap {
			errors[k] = v
		}
		return errorFor(errors)
	}
	return nil
}