ginic

package
v0.3.5-0...-95db35b Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SessionKey .
	SessionKey = "session"
	// HTTPTokenHeaderName .
	HTTPTokenHeaderName = "X-Token"
)

Variables

This section is empty.

Functions

func AuthJWT

func AuthJWT(mgr session.ITokenManager, factory FactoryToIToken) gin.HandlerFunc

AuthJWT .

func CORS

func CORS() gin.HandlerFunc

CORS ...

func LogRequest

func LogRequest(Logger *logger.Logger, logResponse bool) gin.HandlerFunc

LogRequest is a middleware to log each request

func Recovery

func Recovery(out io.Writer) gin.HandlerFunc

Recovery is a middleware to record each panic into file usage like:

gin.Engine.Use(Recovery(*os.File))

func RecoveryWithWriter

func RecoveryWithWriter(out io.Writer) gin.HandlerFunc

RecoveryWithWriter returns a middleware for a given writer that recovers from any panics and writes a 500 if there was one.

Types

type FactoryToIToken

type FactoryToIToken func() session.IToken

FactoryToIToken .

Directories

Path Synopsis
v8
v9

Jump to

Keyboard shortcuts

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