validate.go 319 B

12345678910111213141516
  1. package spec
  2. import "errors"
  3. var ErrMissingService = errors.New("missing service")
  4. // Validate validates Validate the integrity of the spec.
  5. func (s *ApiSpec) Validate() error {
  6. if len(s.Service.Name) == 0 {
  7. return ErrMissingService
  8. }
  9. if len(s.Service.Groups) == 0 {
  10. return ErrMissingService
  11. }
  12. return nil
  13. }