Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Error ¶
type Error struct {
Code string
Parameters []interface{}
}
Error describes error occured during validation.
type MaxLengthValidator ¶
type MaxLengthValidator struct {
Length int
}
MaxLengthValidator controls minimum length.
func MaxLength ¶
func MaxLength(length int) *MaxLengthValidator
MaxLength initializes MaxLengthValidator instance.
func (MaxLengthValidator) Validate ¶
func (validator MaxLengthValidator) Validate(v interface{}) (interface{}, *Error)
Validate do validation.
type MaxValueValidator ¶
type MaxValueValidator struct {
Value float64
}
MaxValueValidator controls maximum value.
func MaxValue ¶
func MaxValue(value float64) *MaxValueValidator
MaxValue initializes MaxValueValidator instance.
func (MaxValueValidator) Validate ¶
func (validator MaxValueValidator) Validate(v interface{}) (interface{}, *Error)
Validate do validation.
type MinLengthValidator ¶
type MinLengthValidator struct {
Length int
}
MinLengthValidator controls minimum length.
func MinLength ¶
func MinLength(length int) *MinLengthValidator
MinLength initializes MinLengthValidator instance.
func (MinLengthValidator) Validate ¶
func (validator MinLengthValidator) Validate(v interface{}) (interface{}, *Error)
Validate do validation.
type MinValueValidator ¶
type MinValueValidator struct {
Value float64
}
MinValueValidator controls minimum value.
func MinValue ¶
func MinValue(value float64) *MinValueValidator
MinValue initializes MinValueValidator instance.
func (MinValueValidator) Validate ¶
func (validator MinValueValidator) Validate(v interface{}) (interface{}, *Error)
Validate do validation.
Click to show internal directories.
Click to hide internal directories.