Documentation
¶
Overview ¶
Provides easy declarative validation of structs of data
These structs will probably be obtained from a XML / JSON deserialization and should be validated before using them in the web application.
Index ¶
- func Run(validations []Func) error
- type FloatFunc
- type Func
- func Float(fieldName string, field float64, validations []FloatFunc) Func
- func If(condition bool, validations []Func) Func
- func Int(fieldName string, field int, validations []IntFunc) Func
- func Int64(fieldName string, field int64, validations []Int64Func) Func
- func Slice(fieldName string, field interface{}, validations []SliceFunc) Func
- func Str(fieldName, field string, validations []StrFunc) Func
- func Struct(fieldName string, field interface{}, validations []StructFunc) Func
- func Time(fieldName string, field *time.Time, validations []TimeFunc) Func
- type Int64Func
- type IntFunc
- type SliceFunc
- type StrFunc
- type StructFunc
- type TimeFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FloatFunc ¶
func FloatPositive ¶
func FloatPositive() FloatFunc
func FloatPositiveZero ¶
func FloatPositiveZero() FloatFunc
func FloatRange ¶
type Func ¶
type Func func() error
func Struct ¶
func Struct(fieldName string, field interface{}, validations []StructFunc) Func
type Int64Func ¶
func MaxValue64 ¶
func MinValue64 ¶
func Positive64 ¶
func Positive64() Int64Func
func PositiveZero64 ¶
func PositiveZero64() Int64Func
type IntFunc ¶
func PositiveZero ¶
func PositiveZero() IntFunc
type TimeFunc ¶
func ParseTimeUnix ¶
Click to show internal directories.
Click to hide internal directories.