middlewares

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccessLogger

func AccessLogger(logger logger.Logger) fiber.Handler

AccessLogger middleware

func CSRFMiddleware

func CSRFMiddleware(session session.Session) fiber.Handler

CSRFMiddleware protection middleware

func GetCSRFKey

func GetCSRFKey(session session.Session) (string, error)

CSRFMiddleware

func GetCookieSession

func GetCookieSession(ctx *fiber.Ctx) session.Session

GetCookieSession get session driver from context

func GetHeaderSession

func GetHeaderSession(ctx *fiber.Ctx) session.Session

GetHeaderSession get session driver from context

func GetSession added in v1.1.0

func GetSession(ctx *fiber.Ctx) session.Session

GetSession get session driver from context

if cookie session exists return cookie session otherwise try to resolve header session or return nil on fail

func JSONOnly

func JSONOnly(ctx *fiber.Ctx) error

JSONOnly implement

func Maintenance

func Maintenance(c cache.Cache) fiber.Handler

Maintenance middleware

func NewCookieSession

func NewCookieSession(
	cache cache.Cache,
	secure bool,
	domain string,
	sameSite string,
	exp time.Duration,
) fiber.Handler

NewCookieSession create new cookie based session

this function generate panic on save fail!

func NewHeaderSession

func NewHeaderSession(
	cache cache.Cache,
	exp time.Duration,
) fiber.Handler

NewHeaderSession create new header based session

this function generate panic on save fail!

func RateLimiter

func RateLimiter(key string, maxAttempts uint32, ttl time.Duration, c cache.Cache) fiber.Handler

RateLimiter middleware

Types

This section is empty.

Jump to

Keyboard shortcuts

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