Documentation ¶
Overview ¶
prometheus中间件
Index ¶
- Variables
- func AddWhiteRouter(data ...string)
- func AdminAuthorizator(data interface{}, c *gin.Context) bool
- func AllUserAuthorizator(data interface{}, c *gin.Context) bool
- func Cors() gin.HandlerFunc
- func GetUserClaims(username string) ([]Claims, error)
- func JwtTokenFilter() gin.HandlerFunc
- func Login(c *gin.Context)
- func Logout(c *gin.Context)
- func NewGinJwtMiddlewares(jwta JwtAuthorizator) *jwt.GinJWTMiddleware
- func NoRouteHandler(c *gin.Context)
- func PromHandler(handler http.Handler) gin.HandlerFunc
- func RefreshToken(c *gin.Context)
- func RegisterHealthMiddleware(c *gin.Context)
- func RegisterIndex(c *gin.Context)
- func RegisterJWT()
- func RegisterPrometheusMiddleware(router *dogo.Rails, isauth bool)
- func RegisterSwaggerMiddleware(router *dogo.Rails)
- func TestAuthorizator(data interface{}, c *gin.Context) bool
- func TokenFilter() gin.HandlerFunc
- func VerifyAuth(username, password string) (bool, error)
- func VerifyAuthByRancher(username, password string) (string, string, bool)
- type IdentityKey
- type JwtAuthorizator
Constants ¶
This section is empty.
Variables ¶
var (
IsRancherLogin bool
)
Functions ¶
func AddWhiteRouter ¶ added in v0.0.3
func AddWhiteRouter(data ...string)
func AdminAuthorizator ¶
role is admin can access
func JwtTokenFilter ¶ added in v0.0.4
func JwtTokenFilter() gin.HandlerFunc
func Login ¶
@Summary 通用接口 @Description 登陆、swagger、注销、404等 @Tags Auth @Param token query string false "token" @Param data body User true "data" @Success 200 {string} string "success" @Security ApiKeyAuth @Router /auth/login [post]
func Logout ¶
@Summary 通用接口 @Description 登陆、swagger、注销、404等 @Tags Auth @Success 200 {string} string "success" @Security ApiKeyAuth @Router /auth/logout [get]
func NewGinJwtMiddlewares ¶
func NewGinJwtMiddlewares(jwta JwtAuthorizator) *jwt.GinJWTMiddleware
根据不同接口的权限规则生成不同权限的jwt中间件
func PromHandler ¶
func PromHandler(handler http.Handler) gin.HandlerFunc
func RefreshToken ¶
@Summary 通用接口 @Description 登陆、swagger、注销、404等 @Tags Auth @Success 200 {string} string "success" @Security ApiKeyAuth @Router /auth/refreshtoken [get]
func RegisterHealthMiddleware ¶
@Summary 健康检查 @Description 接口健康检查接口 @Tags Health @Success 200 {string} string "success" @Router /health [get]
func RegisterIndex ¶ added in v0.0.3
func RegisterPrometheusMiddleware ¶
默认prometheus监控+自定义监控
func TestAuthorizator ¶
username is test can access
func TokenFilter ¶
func TokenFilter() gin.HandlerFunc
Types ¶
type IdentityKey ¶
type IdentityKey string