Documentation ¶
Index ¶
Constants ¶
View Source
const ( UsernameKey = "username" KeyUserID = "userID" UserIP = "ip" )
Variables ¶
View Source
var Middlewares = defaultMiddlewares()
Functions ¶
func Cors ¶
func Cors() gin.HandlerFunc
func TracingHandler ¶
func TracingHandler(service string) gin.HandlerFunc
Types ¶
type AuthOperator ¶
type AuthOperator struct {
// contains filtered or unexported fields
}
AuthOperator 认证实体工厂类
func (*AuthOperator) AuthFunc ¶
func (ao *AuthOperator) AuthFunc() gin.HandlerFunc
AuthFunc 返回一个 gin.HandlerFunc 中间件接口函数
func (*AuthOperator) SetStrategy ¶
func (ao *AuthOperator) SetStrategy(s AuthStrategy)
type AuthStrategy ¶
type AuthStrategy interface { // AuthFunc 相当于是实现了一个名为 AuthFunc 的中间件 AuthFunc() gin.HandlerFunc }
AuthStrategy 认证策略
Click to show internal directories.
Click to hide internal directories.