Documentation ¶
Overview ¶
Package validate wraps an immediate validtor to validate a struct or a variate using comment tags.
Usage:
err := Validator().Struct(...) if err != nil { // handle error ... } // ...
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Validate ¶
type Validate interface { Struct(s interface{}) error StructCtx(ctx context.Context, s interface{}) error Var(field interface{}, tag string) error VarCtx(ctx context.Context, field interface{}, tag string) error }
Validate is a default interface for validating data.
func IsValidate ¶
func IsValidate(wrapped WrappedValidator) (Validate, bool)
IsValidate used to switch to Validate interface.
type WrappedValidator ¶
type WrappedValidator interface { Engine() Validate UniversalTranslator() interface{} }
WrappedValidator is a default interface for approaching the internal instances.
func IsWrapped ¶
func IsWrapped(vali Validate) (WrappedValidator, bool)
IsWrapped used to switch to WrappedValidator interface, used to get the internal instance.
Click to show internal directories.
Click to hide internal directories.