You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
319 B
Go
17 lines
319 B
Go
3 years ago
|
package spec
|
||
|
|
||
|
import "errors"
|
||
|
|
||
|
var ErrMissingService = errors.New("missing service")
|
||
|
|
||
|
// Validate validates Validate the integrity of the spec.
|
||
|
func (s *ApiSpec) Validate() error {
|
||
|
if len(s.Service.Name) == 0 {
|
||
|
return ErrMissingService
|
||
|
}
|
||
|
if len(s.Service.Groups) == 0 {
|
||
|
return ErrMissingService
|
||
|
}
|
||
|
return nil
|
||
|
}
|