gin

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2024 License: MIT Imports: 15 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Convert

func Convert(handler http.HandlerFunc) gin.HandlerFunc

func Converts

func Converts(handlers []http.HandlerFunc) []gin.HandlerFunc

func Debug

func Debug(r *gin.Engine)

func FromStdWithNext

func FromStdWithNext(h func(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)) gin.HandlerFunc

func OpenApi

func OpenApi(mux *gin.Engine, filePath string)

func Prom

func Prom(r *gin.Engine)

func RespErrRep

func RespErrRep(ctx *gin.Context, rep *errcode.ErrRep)

func RespErrcode

func RespErrcode(ctx *gin.Context, code errcode.ErrCode)

func Response

func Response(ctx *gin.Context, code errcode.ErrCode, msg string, data interface{})

func SuccessRespMsg added in v0.0.8

func SuccessRespMsg(ctx *gin.Context, msg string)

func SuccessResponse added in v0.0.8

func SuccessResponse[T any](ctx *gin.Context, msg string, data T)

func Wrap

func Wrap(handler interface{}) gin.HandlerFunc

Wrap converts native http.Handler & http.HandlerFunc to gin.HandlerFunc.

Supported form types:

.Wrap(h http.Handler)
.Wrap(func(w http.ResponseWriter, r *http.Request))
.Wrap(func(w http.ResponseWriter, r *http.Request, next http.HandlerFunc))

Types

type Config

type Config gin.Engine

func (*Config) New

func (c *Config) New() *gin.Engine

type ExportService

type ExportService struct{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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