hotgo/server/internal/service/middleware.go
2022-12-11 20:48:18 +08:00

38 lines
883 B
Go

// ================================================================================
// Code generated by GoFrame CLI tool. DO NOT EDIT.
// You can delete these comments if you wish manually maintain this interface file.
// ================================================================================
package service
import (
"github.com/gogf/gf/v2/net/ghttp"
)
type (
IMiddleware interface {
AdminAuth(r *ghttp.Request)
ApiAuth(r *ghttp.Request)
Ctx(r *ghttp.Request)
CORS(r *ghttp.Request)
DemoLimit(r *ghttp.Request)
ResponseHandler(r *ghttp.Request)
WebSocketToken(r *ghttp.Request)
}
)
var (
localMiddleware IMiddleware
)
func Middleware() IMiddleware {
if localMiddleware == nil {
panic("implement not found for interface IMiddleware, forgot register?")
}
return localMiddleware
}
func RegisterMiddleware(i IMiddleware) {
localMiddleware = i
}