middleware

package
v0.0.0-...-1f200ce Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authenticator

func Authenticator() gin.HandlerFunc

func ConnectDB

func ConnectDB(dataURL string) (err error)

func ConnectSession

func ConnectSession(key string)

func DBConnector

func DBConnector() gin.HandlerFunc

func GetDB

func GetDB(c *gin.Context) *mgo.Session

func GetLogger

func GetLogger(c *gin.Context) *logrus.Logger

func GetToken

func GetToken(c *gin.Context) (*models.Token, error)

func GetUserID

func GetUserID(c *gin.Context) string

func Logger

func Logger() gin.HandlerFunc

func Recoverer

func Recoverer() gin.HandlerFunc

Recoverer catches the panic from the handler gracefully and logs the error with stack trace.

func SetToken

func SetToken(c *gin.Context, token *models.Token) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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