Documentation ¶
Index ¶
- Constants
- Variables
- func Allowz() gin.HandlerFunc
- func Cors() gin.HandlerFunc
- func IsAllow(c *gin.Context) bool
- func ListPlugins() []string
- func Logging() gin.HandlerFunc
- func MetricsFunc() gin.HandlerFunc
- func Recovery() gin.HandlerFunc
- func Register(plugin *Instance)
- func RequestInfo() gin.HandlerFunc
- type AllowConfig
- type Instance
- type Instances
- type String
Constants ¶
View Source
const ( ALLOW = "ALLOW" ALLOWWEIGHT = 90 )
View Source
const ( CORS = "CORS" CORSWEIGHT = 50 )
View Source
const ( ACCESSLOG = "ACCESSLOG" ACCESSLOGWEIGHT = 101 STACKLOG = "STACKLOG" STACKLOGWEIGHT = 102 )
View Source
const ( METRICS = "METRICS" METRICSWEIGHT = 80 )
View Source
const ( REQUESTINFO = "REQUESTINFO" REQUESTINFOWEIGHT = 120 )
Variables ¶
View Source
var ( ErrMiddlewareRegisterNil = fmt.Errorf("middleware: Register adapter is nil") ErrMiddlewareDoubleRegister = fmt.Errorf("middleware: Register called twice for adapter: ") )
Functions ¶
func Allowz ¶
func Allowz() gin.HandlerFunc
func MetricsFunc ¶
func MetricsFunc() gin.HandlerFunc
func Recovery ¶
func Recovery() gin.HandlerFunc
func RequestInfo ¶
func RequestInfo() gin.HandlerFunc
Types ¶
type AllowConfig ¶
type Instance ¶
type Instance struct { F func() gin.HandlerFunc // middle instance Weight uint // plugin load weight 越大到越靠前load Name string // plugin name }
func AllMiddlewarePlugins ¶
func AllMiddlewarePlugins() []*Instance
Click to show internal directories.
Click to hide internal directories.