valid

package
v0.0.71 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2023 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Trans 定义一个全局翻译器T

Functions

func InitRequestParamValidate

func InitRequestParamValidate()

InitRequestParamValidate 初始化翻译器

func ShouldBind

func ShouldBind[T any](ctx *gin.Context) (T, bool)

ShouldBind 解析请求参数并校验 T 返回 请求数据 解析失败或者参数校验失败,返回 false 并组织响应数据结构 参数校验成功,返回 true

req, ok := valid.ShouldBind[model.CreateUserReq](ctx)

if ok {
    return
}

Types

This section is empty.

Jump to

Keyboard shortcuts

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