Documentation ¶
Index ¶
- Constants
- func DefaultValidate(b interface{}, customRules []Rule) (bool, error)
- func RawDefaultValidate(b interface{}, tn string, customRules []Rule) (bool, error)
- func RawValidate(b interface{}, tn string, rules []Rule) (bool, error)
- func Validate(b interface{}, rules []Rule) (bool, error)
- func ValidateFields(fields []Field, rules []Rule) (bool, error)
- type ErrDuplicatedRule
- type ErrEmptyTagName
- type ErrInvalidBody
- type ErrInvalidTag
- type Field
- type Rule
- type Validator
Constants ¶
View Source
const DefaultTagName = "validate"
Variables ¶
This section is empty.
Functions ¶
func DefaultValidate ¶
func RawDefaultValidate ¶
Types ¶
type ErrDuplicatedRule ¶
type ErrDuplicatedRule struct {
RuleDuplicated Rule
}
func (*ErrDuplicatedRule) Error ¶
func (err *ErrDuplicatedRule) Error() string
type ErrEmptyTagName ¶
type ErrEmptyTagName struct{}
func (*ErrEmptyTagName) Error ¶
func (e *ErrEmptyTagName) Error() string
type ErrInvalidBody ¶
ErrInvalidBody represents all invalid body report
func (*ErrInvalidBody) Error ¶
func (e *ErrInvalidBody) Error() string
type ErrInvalidTag ¶
type ErrInvalidTag struct {
Format string
}
ErrInvalidTag represents all invalid tag report
func (*ErrInvalidTag) Error ¶
func (e *ErrInvalidTag) Error() string
type Field ¶
Field is a struct to represents the domain about a field inner gody lib
func RawSerialize ¶
RawSerialize is a func to serialize/parse all content about the struct input
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
func NewValidator ¶
func NewValidator() *Validator
func (*Validator) SetTagName ¶
Click to show internal directories.
Click to hide internal directories.