ginx

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: MIT Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Wrap

func Wrap(fn func(ctx *gin.Context) (Result, error)) gin.HandlerFunc

func WrapBody

func WrapBody[Req any](fn func(ctx *gin.Context, req Req) (Result, error)) gin.HandlerFunc

func WrapFinder added in v1.8.0

func WrapFinder(fn func(ctx *gin.Context) (Result, error)) gin.HandlerFunc

func WrapFinderBody added in v1.8.0

func WrapFinderBody[Req any](fn func(ctx *gin.Context, req Req) (Result, error)) gin.HandlerFunc

func Ws added in v1.8.0

func Ws(fn func(ctx *gin.Context) error) gin.HandlerFunc

Types

type ErrorCoder added in v1.11.1

type ErrorCoder interface {
	error
	GetCode() int
	GetMsg() string
}

ErrorCoder 定义了包含错误码和错误消息的错误接口

type Result

type Result struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
	Data any    `json:"data"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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