ginx

package module
v0.0.0-...-53f744f Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

README

ginx

GIN 的加强版,提供了一些比较好用的特性,以及一些基于个人理解的新插件。

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoResponse = errs.ErrNoResponse
View Source
var ErrUnauthorized = errs.ErrUnauthorized

Functions

func B

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

func BS

func BS[Req any](fn func(ctx *Context, req Req, sess session.Session) (Result, error)) gin.HandlerFunc

BS 的意思是,传入的业务逻辑方法可以接受 req 和 sess 两个参数

func S

func S(fn func(ctx *Context, sess session.Session) (Result, error)) gin.HandlerFunc

S 的意思是,传入的业务逻辑方法可以接受 Session 参数

func W

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

Types

type Context

type Context = gctx.Context

type Handler

type Handler interface {
	PrivateRoutes(server *gin.Engine)
	PublicRoutes(server *gin.Engine)
}

type Result

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

Directories

Path Synopsis
internal
e2e
jwt
mocks
Code generated by MockGen.
Code generated by MockGen.
ratelimit/mocks
Code generated by MockGen.
Code generated by MockGen.
middlewares

Jump to

Keyboard shortcuts

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