Documentation ¶
Index ¶
- func Form(ctx iris.Context, v any) (err error)
- func FormWithQuery(ctx iris.Context, v any) (err error)
- func Json(ctx iris.Context, v any) (err error)
- func JsonWithQuery(ctx iris.Context, v any) (err error)
- func Query(ctx iris.Context, v any) (err error)
- func Struct(v any) (err error)
- func Xml(ctx iris.Context, v any) (err error)
- func XmlWithQuery(ctx iris.Context, v any) (err error)
- type OperatorLanguageRegister
- type OperatorManager
- type ValidationAfter
- type ValidationBefore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormWithQuery ¶
FormWithQuery read data from url string and form that formatted as application/x-www-form-urlencoded.
func JsonWithQuery ¶
JsonWithQuery read data from url string and form that formatted as application/json.
func XmlWithQuery ¶
XmlWithQuery read data from url string and form that formatted as application/xml.
Types ¶
type OperatorLanguageRegister ¶
type OperatorLanguageRegister func(v *vv.Validate, ts ut.Translator) (err error)
OperatorLanguageRegister is a type use to register validation language.
type OperatorManager ¶
type OperatorManager interface { // Language // config operator language. Language(fn OperatorLanguageRegister, t l0.Translator) OperatorManager // LanguageWithChinese // config operator language as chinese. LanguageWithChinese() OperatorManager // LanguageWithEnglish // config operator language as english. LanguageWithEnglish() OperatorManager // Register // adds a validation to validate lib. Register(name string, validation func(fl vv.FieldLevel) bool) OperatorManager // Struct // validate a struct definition. Struct(v any) (err error) StructWithReader(v any, calls ...func(v any) error) (err error) }
OperatorManager is an interface for validate operations.
var Operator OperatorManager = (*operator)(nil)
Operator is a singleton instance for validate operations.
type ValidationAfter ¶
type ValidationAfter interface {
AfterValidate() (err error)
}
type ValidationBefore ¶
type ValidationBefore interface {
BeforeValidate() (err error)
}
Click to show internal directories.
Click to hide internal directories.