ginx

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2025 License: Apache-2.0 Imports: 7 Imported by: 13 modules, 8 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.

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