middleWare

package
v0.0.0-...-d09ac20 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2019 License: Apache-2.0 Imports: 12 Imported by: 2

Documentation

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 GenTraceId

func GenTraceId() gin.HandlerFunc

生成追踪Id

func JWTInit

func JWTInit(jwtAuthorizator JwtAuthorizator) (authMiddleware *jwt.GinJWTMiddleware)

func LoggingInterceptor

func LoggingInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)

拦截器-input/output日志输出

func RecoveryInterceptor

func RecoveryInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error)

拦截器-recover

Types

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