middleware

package
v0.0.0-...-0b2cb5f Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Logger

func Logger(fields ...LoggerField) func(*gin.Context)

Logger use for gin middleware

func ParseAndValidToken

func ParseAndValidToken(key []byte, token string) (string, error)

func Recovery

func Recovery() func(*gin.Context)

func TokenAuthMiddleware

func TokenAuthMiddleware(headerKey, userIDKey, signKey string) func(*gin.Context)

Types

type LoggerField

type LoggerField map[string]func(*gin.Context) string

func GetTokenField

func GetTokenField(tokenKey string) LoggerField

func GetUserIDField

func GetUserIDField(userIDKey string) LoggerField

func WarpContextField

func WarpContextField(contextKey, key string) LoggerField

Jump to

Keyboard shortcuts

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