gu

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cors

func Cors() gin.HandlerFunc

func Failed

func Failed(ctx *gin.Context, message string)

func FailedWithCode added in v0.0.2

func FailedWithCode(ctx *gin.Context, code int, message string)

func Ok

func Ok(ctx *gin.Context, data any)

func ResponseJson

func ResponseJson(ctx *gin.Context, code int, message string, data any)

func SetValidatorTrans

func SetValidatorTrans(local string) (err error)

loca 通常取决于 http 请求头的 'Accept-Language'

func ValidatorErrors

func ValidatorErrors(ctx *gin.Context, err error)

Types

type PageData

type PageData struct {
	Total    int64 `json:"total"`
	PageID   int64 `json:"page_id"`
	PageSize int64 `json:"page_size"`
	Result   any   `json:"result"`
}

Jump to

Keyboard shortcuts

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