Documentation
¶
Index ¶
- Variables
- func Failed(fv FieldValidator, errStr, got string) error
- func NewValidationError(errors []error) *validationError
- func Passed(fv FieldValidator, value, test string) error
- func RegisterValidator(name string, fn ValidatorFunc) error
- func TryConnect(chain, providerUrl string, maxAttempts int) error
- func Validate(input interface{}) error
- type Enabler
- type FieldValidator
- type ValidatorFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ValidatorRegistry = make(map[string]ValidatorFunc)
Validator registry
Functions ¶
func Failed ¶
func Failed(fv FieldValidator, errStr, got string) error
func NewValidationError ¶
func NewValidationError(errors []error) *validationError
func Passed ¶
func Passed(fv FieldValidator, value, test string) error
func RegisterValidator ¶
func RegisterValidator(name string, fn ValidatorFunc) error
RegisterValidator registers a new validator function if it does not already exist. If it does, it returns an error.
func TryConnect ¶
Types ¶
type FieldValidator ¶
type FieldValidator struct {
// contains filtered or unexported fields
}
FieldValidator holds everything needed to validate a single field.
func NewFieldValidator ¶
func NewFieldValidator(name, typ, fld, ctx string) FieldValidator
func (FieldValidator) Context ¶
func (fv FieldValidator) Context() string
func (FieldValidator) Root ¶
func (fv FieldValidator) Root() interface{}
type ValidatorFunc ¶
type ValidatorFunc func(fv FieldValidator) error
ValidatorFunc defines the signature for validation functions.
Click to show internal directories.
Click to hide internal directories.