File size: 469 Bytes
cee2387 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | package models
import "errors"
type FeatureKeyAndID struct {
Key string `json:"key"`
ID string `json:"id"`
}
func (f FeatureKeyAndID) Validate() error {
if f.Key == "" {
return errors.New("key is required")
}
if f.ID == "" {
return errors.New("id is required")
}
return nil
}
type NamespaceID struct {
ID string `json:"id"`
}
func (i NamespaceID) Validate() error {
if i.ID == "" {
return errors.New("namespace-id is required")
}
return nil
}
|