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 22 23 | package models
import (
"fmt"
)
type NamespacedID struct {
Namespace string `json:"namespace"`
ID string `json:"id"`
}
func (i NamespacedID) Validate() error {
if i.Namespace == "" {
return fmt.Errorf("namespace is required")
}
if i.ID == "" {
return fmt.Errorf("id is required")
}
return nil
}
|