Documentation ¶
Index ¶
- func GetFormValues(r *http.Request) (map[string]any, error)
- func GetRemoteAddr(r *http.Request) string
- func Parse(r *http.Request, v any, isValidate bool) error
- func ParseAcceptLanguage(lang string) (string, error)
- func ParseForm(r *http.Request, v any) error
- func ParseHeader(headerValue string) map[string]string
- func ParseHeaders(r *http.Request, v any) error
- func ParseJsonBody(r *http.Request, v any) error
- func ParsePath(r *http.Request, v any) error
- func RegisterValidation(tag string, fn validator.Func)
- func RegisterValidationTranslation(tag string, trans ut.Translator, registerFn validator.RegisterTranslationsFunc, ...)
- func SetValidatorErrorCode(code int)
- type Validator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFormValues ¶
GetFormValues returns the form values.
func GetRemoteAddr ¶
GetRemoteAddr returns the peer address, supports X-Forward-For.
func ParseAcceptLanguage ¶
func ParseHeader ¶
ParseHeader parses the request header and returns a map.
func ParseHeaders ¶
ParseHeaders parses the headers request.
func ParseJsonBody ¶
ParseJsonBody parses the post request which contains json in body.
func ParsePath ¶
ParsePath parses the symbols reside in url path. Like http://localhost/bag/:name
func RegisterValidation ¶
func RegisterValidation(tag string, fn validator.Func)
RegisterValidation registers the validation function to validator
func RegisterValidationTranslation ¶
func RegisterValidationTranslation(tag string, trans ut.Translator, registerFn validator.RegisterTranslationsFunc, translationFn validator.TranslationFunc)
RegisterValidationTranslation regiters the validation translation for validator
func SetValidatorErrorCode ¶
func SetValidatorErrorCode(code int)
SetValidatorErrorCode sets the error code for validator when errors occurs
Types ¶
Click to show internal directories.
Click to hide internal directories.