gin

package
v0.0.37 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2024 License: MIT Imports: 16 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, uriPrefix, dir 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 RespSuccess added in v0.0.28

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

func RespSuccessMsg added in v0.0.28

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

func Response

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

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