40 lines
939 B
Go
40 lines
939 B
Go
// ================================================================================
|
|
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
|
// You can delete these comments if you wish manually maintain this interface file.
|
|
// ================================================================================
|
|
|
|
package service
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/gogf/gf/v2/net/ghttp"
|
|
)
|
|
|
|
type (
|
|
IMiddleware interface {
|
|
ResponseHandler(r *ghttp.Request)
|
|
Ctx(r *ghttp.Request)
|
|
CORS(r *ghttp.Request)
|
|
Auth(r *ghttp.Request)
|
|
IsExceptLogin(ctx context.Context, path string) bool
|
|
OperationLog(r *ghttp.Request)
|
|
ResponseHandlerRaw(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
|
|
}
|