Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrValidatorExists is returned by RegisterValidator when a // validator with the same name has already been registered. ErrValidatorExists = errors.New("validator already registered") )
Functions ¶
func RegisterValidator ¶
func RegisterValidator(name string, fn ValidatorFunc) error
RegisterValidator registers a validator under the given name. It returns an error if the name is already registered.
func Registered ¶
func Registered() []string
Registered returns the names of all registered validators.
Types ¶
type ValidatorFunc ¶
ValidatorFunc validates a value. It should return an error if the value is invalid.
func GetValidator ¶
func GetValidator(name string) (ValidatorFunc, bool)
GetValidator retrieves a validator by name.
type ValidatorPlugin ¶
ValidatorPlugin is implemented by runtime validator plugins.
Click to show internal directories.
Click to hide internal directories.