Documentation ¶
Index ¶
- func AdminAuthorizator(data interface{}, c *gin.Context) bool
- func AllUserAuthorizator(data interface{}, c *gin.Context) bool
- func Cors() gin.HandlerFunc
- func GenTraceId() gin.HandlerFunc
- func JWTInit(jwtAuthorizator JwtAuthorizator) (authMiddleware *jwt.GinJWTMiddleware)
- func LoggingInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (interface{}, error)
- func RecoveryInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (resp interface{}, err error)
- type JwtAuthorizator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AdminAuthorizator ¶
role is admin can access
func AllUserAuthorizator ¶
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 ¶
Click to show internal directories.
Click to hide internal directories.