src

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 15, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Form

func Form(ctx iris.Context, v any) (err error)

Form read data from a form that formatted as application/x-www-form-urlencoded.

func FormWithQuery

func FormWithQuery(ctx iris.Context, v any) (err error)

FormWithQuery read data from url string and form that formatted as application/x-www-form-urlencoded.

func Json

func Json(ctx iris.Context, v any) (err error)

Json read data from a form that formatted as application/json.

func JsonWithQuery

func JsonWithQuery(ctx iris.Context, v any) (err error)

JsonWithQuery read data from url string and form that formatted as application/json.

func Query

func Query(ctx iris.Context, v any) (err error)

Query read data from url string.

func Struct

func Struct(v any) (err error)

Struct validate a struct instance.

func Xml

func Xml(ctx iris.Context, v any) (err error)

Xml read data from a form that formatted as application/xml.

func XmlWithQuery

func XmlWithQuery(ctx iris.Context, v any) (err error)

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)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL