Documentation ¶
Index ¶
- func AddMiddleware(middleware Middleware)
- func Authenticator(c *gin.Context) (interface{}, error)
- func Authorizator(data interface{}, c *gin.Context) bool
- func IdentityHandler(c *gin.Context) interface{}
- func LoginResponse(c *gin.Context, code int, token string, expire time.Time)
- func LogoutResponse(c *gin.Context, code int)
- func PayloadFunc(data interface{}) jwt.MapClaims
- func RecordMetrics(method, uri string, success bool, httpCode, businessCode int, ...)
- func RefreshResponse(c *gin.Context, code int, token string, expire time.Time)
- func Unauthorized(c *gin.Context, code int, msg string)
- type Credential
- type Login
- type Middleware
- type Role
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddMiddleware ¶
func AddMiddleware(middleware Middleware)
func Authenticator ¶
func Authorizator ¶
func IdentityHandler ¶
func LogoutResponse ¶
func PayloadFunc ¶
func RecordMetrics ¶
func RecordMetrics(method, uri string, success bool, httpCode, businessCode int, costSeconds float64, traceId string)
RecordMetrics 记录指标
func RefreshResponse ¶
Types ¶
type Credential ¶
type Middleware ¶
type Middleware interface { Init() Apply(r *gin.Engine) Get() gin.HandlerFunc Destroy() }
func GetMiddlewares ¶
func GetMiddlewares() []Middleware
Click to show internal directories.
Click to hide internal directories.