File size: 319 Bytes
fea99b3 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | package models
import "fmt"
type NamespacedKey struct {
Namespace string `json:"namespace"`
Key string `json:"key"`
}
func (k NamespacedKey) Validate() error {
if k.Namespace == "" {
return fmt.Errorf("namespace is required")
}
if k.Key == "" {
return fmt.Errorf("key is required")
}
return nil
}
|