ginutil

package
v1.4.5 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bad

func Bad(c *gin.Context, params ...interface{})

Bad 错误的请求

func BadError

func BadError(c *gin.Context, status int, data interface{}, params ...interface{})

BadError 返回错误信息

func BadRequest

func BadRequest(ctx *gin.Context, v any) error
func Cookie(c *gin.Context, name, value string, maxAge int)

Cookie 设置Cooke

func GetClientIP

func GetClientIP(c *gin.Context) string

func GetInt

func GetInt(r *http.Request, key string) int

func GetInt64

func GetInt64(r *http.Request, key string) int64

func GetInt64Param

func GetInt64Param(c *gin.Context, key string) int64

func GetInt64Query

func GetInt64Query(c *gin.Context, key string) int64

func GetPathInt64

func GetPathInt64(c *gin.Context, key string, defaultValue int64) int64

func Ok

func Ok(c *gin.Context, params ...interface{})

Ok 返回成功信息, params作为动态参数,默认没有参数则返回204

func OkList

func OkList(c *gin.Context, list interface{}, total int64)

OkList 返回成功列表

func ParamInt64

func ParamInt64(c *gin.Context, key string) int64

func ShouldJson

func ShouldJson(c *gin.Context, v any) error

func Status

func Status(ctx *gin.Context, status int) error

func StatusOK

func StatusOK(c *gin.Context, data interface{}) error

func UidGet

func UidGet(c *gin.Context) int64

Types

This section is empty.

Jump to

Keyboard shortcuts

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