middlewares

package
v0.0.0-...-48145d3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2020 License: MIT Imports: 15 Imported by: 2

Documentation

Overview

prometheus中间件

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdminAuthorizator

func AdminAuthorizator(data interface{}, c *gin.Context) bool

role is admin can access

func AllUserAuthorizator

func AllUserAuthorizator(data interface{}, c *gin.Context) bool

func Cors

func Cors() gin.HandlerFunc

跨域设置

func CreateServiceDiscovery

func CreateServiceDiscovery(regAddr, basePath string) (client.ServiceDiscovery, error)

func NewGinJwtMiddlewares

func NewGinJwtMiddlewares(jwta JwtAuthorizator) *jwt.GinJWTMiddleware

根据不同接口的权限规则生成不同权限的jwt中间件

func NoRouteHandler

func NoRouteHandler(c *gin.Context)

404 handler

func Register404Middleware

func Register404Middleware(router *gin.Engine)

func RegisterPrometheusMiddleware

func RegisterPrometheusMiddleware(router *gin.Engine, isauth bool)

func RegisterSwaggerMiddleware

func RegisterSwaggerMiddleware(router *gin.Engine)

func TestAuthorizator

func TestAuthorizator(data interface{}, c *gin.Context) bool

username is test can access

Types

type IdentityKey

type IdentityKey string

type JwtAuthorizator

type JwtAuthorizator func(data interface{}, c *gin.Context) bool

接口权限

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL