Documentation ¶
Overview ¶
Package middleware @Link https://gitee.com/linngc/webos.gf @Copyright Copyright (c) 2022 webos CLI @Author linngc @License
Package middleware @Link https://gitee.com/linngc/webos.gf @Copyright Copyright (c) 2022 webos CLI @Author linngc @License
Package middleware @Link https://gitee.com/linngc/webos.gf @Copyright Copyright (c) 2022 webos CLI @Author linngc @License
Package middleware @Link https://gitee.com/linngc/webos.gf @Copyright Copyright (c) 2022 webos CLI @Author linngc @License
Package middleware @Link https://gitee.com/linngc/webos.gf @Copyright Copyright (c) 2022 webos CLI @Author linngc @License
Package middleware @Link https://gitee.com/linngc/webos.gf @Copyright Copyright (c) 2022 webos CLI @Author linngc @License
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterAction ¶
func RegisterAction(i IAction)
func RegisterBizCtx ¶
func RegisterBizCtx(i IBizCtx)
func RegisterMiddleware ¶
func RegisterMiddleware(i IMiddleware)
func RegisterMiddlewareJwt ¶
func RegisterMiddlewareJwt(i IJwtAuth)
func RegisterSession ¶
func RegisterSession(i ISession)
Types ¶
type IAction ¶
type IBizCtx ¶
type IJwtAuth ¶
type IJwtAuth interface {
Auth() *jwt.GfJWTMiddleware
}
type IMiddleware ¶
type IMiddleware interface { ResponseHttpHandler(r *ghttp.Request) //全局返回数据拦截(计算HTTP请求数据) ResponseProxyHandler(r *ghttp.Request) //全局返回数据拦截(计算代理接口请求数据) ResponseHandler(r *ghttp.Request) //返回处理中间件(全局返回数据拦截) Ctx(r *ghttp.Request) //自定义上下文对象 Auth(r *ghttp.Request) //前台系统权限控制,用户必须登录才能访问 CORS(r *ghttp.Request) //CORS垮域处理 CSRF(r *ghttp.Request) //CSRF防御设置 JwtAuth(r *ghttp.Request) //jwt权限验证 }
func Middleware ¶
func Middleware() IMiddleware
type ISession ¶
type ISession interface { SetSysUser(ctx context.Context, user *entity.SysUser) error GetSysUser(ctx context.Context) *entity.SysUser RemoveSysUser(ctx context.Context) error SetLoginReferer(ctx context.Context, referer string) error GetLoginReferer(ctx context.Context) string RemoveLoginReferer(ctx context.Context) error }