gin

package
v3.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2025 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CORS

func CORS() gin.HandlerFunc

func CORSPreCheckRequest

func CORSPreCheckRequest() gin.HandlerFunc

func DefaultLogger

func DefaultLogger() gin.HandlerFunc

func HTTPHandler

func HTTPHandler(routers ...Router) *gin.Engine

func RecoveryWithWriter

func RecoveryWithWriter(out io.Writer) gin.HandlerFunc

func SignAuthMiddleware

func SignAuthMiddleware(secretKeyMap map[string]string, timeWindow time.Duration, toStringFunc func(any) string) gin.HandlerFunc

Types

type DefaultRouter

type DefaultRouter struct {
	RouterGroup
	// contains filtered or unexported fields
}

func NewApiRouter

func NewApiRouter(path string) *DefaultRouter

func NewDefaultRouter

func NewDefaultRouter(path string) *DefaultRouter

func (*DefaultRouter) RegisterHandler

func (d *DefaultRouter) RegisterHandler(engine *gin.Engine)

type Router

type Router interface {
	RegisterHandler(engine *gin.Engine)
}

type RouterGroup

type RouterGroup struct {
	// contains filtered or unexported fields
}

func (*RouterGroup) Any

func (group *RouterGroup) Any(relativePath string, handlers ...gin.HandlerFunc)

func (*RouterGroup) DELETE

func (group *RouterGroup) DELETE(relativePath string, handlers ...gin.HandlerFunc)

func (*RouterGroup) GET

func (group *RouterGroup) GET(relativePath string, handlers ...gin.HandlerFunc)

func (*RouterGroup) Group

func (group *RouterGroup) Group(relativePath string, handlers ...gin.HandlerFunc) *RouterGroup

func (*RouterGroup) HEAD

func (group *RouterGroup) HEAD(relativePath string, handlers ...gin.HandlerFunc)

func (*RouterGroup) Match

func (group *RouterGroup) Match(methods []string, relativePath string, handlers ...gin.HandlerFunc)

func (*RouterGroup) OPTIONS

func (group *RouterGroup) OPTIONS(relativePath string, handlers ...gin.HandlerFunc)

func (*RouterGroup) PATCH

func (group *RouterGroup) PATCH(relativePath string, handlers ...gin.HandlerFunc)

func (*RouterGroup) POST

func (group *RouterGroup) POST(relativePath string, handlers ...gin.HandlerFunc)

func (*RouterGroup) PUT

func (group *RouterGroup) PUT(relativePath string, handlers ...gin.HandlerFunc)

func (*RouterGroup) Use

func (group *RouterGroup) Use(middleware ...gin.HandlerFunc) *RouterGroup

Jump to

Keyboard shortcuts

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