gin

package
v0.14.8-b4 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CookieDeleteMe            = "DeleteMe"
	CookieDeleteMaxAge        = 0
	CookieDeleteVal           = ""
	DefaultMaxRequestBodySize = 104857600 // 100MB
)

Variables

This section is empty.

Functions

func CheckHeaderParams added in v0.13.27

func CheckHeaderParams(name string, v *string, ctx *gin.Context) bool

func CheckHeaderParamsWithErrorMsg added in v0.13.27

func CheckHeaderParamsWithErrorMsg(name string, v *string, errorMsg string, ctx *gin.Context) bool

func CheckParamsWithErrorMsg added in v0.13.27

func CheckParamsWithErrorMsg(name string, str string, v *string, errorMsg string, ctx *gin.Context) bool

func CheckPostFormParams added in v0.13.27

func CheckPostFormParams(name string, v *string, ctx *gin.Context) bool

func CheckPostFormParamsWithErrorMsg added in v0.13.27

func CheckPostFormParamsWithErrorMsg(name string, v *string, errorMsg string, ctx *gin.Context) bool

func CheckQueryParams added in v0.13.27

func CheckQueryParams(name string, v *string, ctx *gin.Context) bool

func CheckQueryParamsWithErrorMsg added in v0.13.27

func CheckQueryParamsWithErrorMsg(name string, v *string, errorMsg string, ctx *gin.Context) bool

func ClearCookie added in v0.14.7

func ClearCookie(ctx *gin.Context, domain string, path string, keys ...string)

if len(keys)==0 this function will delete all cookies

func GetCookie added in v0.14.7

func GetCookie(name string, ctx *gin.Context) string

func GetTraceContext added in v0.12.12

func GetTraceContext(ctx *gin.Context) context.Context

func InitTrans added in v0.6.21

func InitTrans(locale string, validate binding.StructValidator) (err error)

InitTrans 初始化翻译器

func NewServer

func NewServer(options server.Options, routerProvider func(engine *gin.Engine), middleware ...gin.HandlerFunc) server.Server

func PostFormArray added in v0.13.27

func PostFormArray(ctx *gin.Context, name string) []string

func ProxyService added in v0.13.25

func ProxyService(serviceName, path string, ctx *gin.Context, timeout time.Duration) error

func QueryArray added in v0.13.27

func QueryArray(ctx *gin.Context, name string) []string

func SendJSON added in v0.13.27

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

func SetCookie added in v0.14.7

func SetCookie(c cookie.Cookie, ctx *gin.Context)

func ShouldBind added in v0.13.27

func ShouldBind(ctx *gin.Context, obj any) (err error)

优先级 path > form > query > cookie > header > json > raw_body

func ShouldBindAndValidate added in v0.13.27

func ShouldBindAndValidate(ctx *gin.Context, data any) error

Types

type Server

type Server struct {
	Srv     *gin.Engine
	Options server.Options
}

func (*Server) GetServeServer added in v0.9.6

func (server *Server) GetServeServer() any

func (*Server) Run

func (server *Server) Run(graceful ...func())

func (*Server) Shutdown

func (server *Server) Shutdown()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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