Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IWebCheckRight ¶
type IWebCheckRight struct {
// IrpcCheckAllowed
IwebCheckAllowed
IwebRegister
}
type IrpcCheckAllowed ¶
type IrpcCheckAllowed interface {
// 测试开关、是否检查权限,方便测试可以关闭
IfCheckRes() bool
// 是否检查token
IfCheckSession() bool
// 根据token获取useid的实现
RpcUserIdGetBySession(ctx *gin.Context, token string) (*webdto.WebUserId, error)
// RPC 设置ctx上下文的CooUserID信息的实现
RpcSetUserId(c *gin.Context) //set *webdto.WebUserId
// RPC 获取ctx上下文的CooUserID信息的 实现
RpcGetUserId(ctx *gin.Context) *webdto.WebUserId
//rpc 检查权限的实现
RpcCheckAllowed(ctx context.Context, req *webdto.WebCheckRequest) (*webdto.WebCheckResult, error)
}
type IwebCheckAllowed ¶
type IwebCheckAllowed interface {
SetUserId(c *gin.Context)
GetUserId(ctx *gin.Context) *webdto.WebUserId
CheckSessionToken(c *gin.Context) gin.HandlerFunc
GetSessionToken(c *gin.Context) (int, *webdto.WebUserId, error)
WebCheckAllowed(c *gin.Context)
}
服务上下文获取信息,应用消费者使用接口
type IwebRegister ¶
type IwebRegister interface {
RegisterMiddlewares(middlewares ...gin.HandlerFunc)
RegisterIrpc(irpc IrpcCheckAllowed)
}
注册代理对象
Click to show internal directories.
Click to hide internal directories.