Documentation ¶
Index ¶
- func Convert(handler http.HandlerFunc) gin.HandlerFunc
- func Converts(handlers []http.HandlerFunc) []gin.HandlerFunc
- func Debug(r *gin.Engine)
- func FromStdWithNext(h func(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)) gin.HandlerFunc
- func HandlerWrap[REQ, RES any](service GinService[*REQ, *RES]) gin.HandlerFunc
- func HandlerWrapCompatibleGRPC[REQ, RES any](service types.GrpcServiceMethod[*REQ, *RES]) gin.HandlerFunc
- func Prom(r *gin.Engine)
- func RespErrRep(ctx *gin.Context, rep *errcode.ErrRep)
- func RespErrcode(ctx *gin.Context, code errcode.ErrCode)
- func RespSuccess[T any](ctx *gin.Context, msg string, data T)
- func RespSuccessMsg(ctx *gin.Context, msg string)
- func Response(ctx *gin.Context, code errcode.ErrCode, msg string, data interface{})
- func Wrap(handler interface{}) gin.HandlerFunc
- type Config
- type ExportService
- type GinService
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 FromStdWithNext ¶
func FromStdWithNext(h func(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)) gin.HandlerFunc
func HandlerWrap ¶ added in v0.3.0
func HandlerWrap[REQ, RES any](service GinService[*REQ, *RES]) gin.HandlerFunc
func HandlerWrapCompatibleGRPC ¶ added in v0.3.0
func HandlerWrapCompatibleGRPC[REQ, RES any](service types.GrpcServiceMethod[*REQ, *RES]) gin.HandlerFunc
func RespSuccessMsg ¶ added in v0.0.28
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 ExportService ¶
type ExportService struct{}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.