middlewares

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2023 License: ISC Imports: 10 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 JSONOnly

func JSONOnly(callback fiber.Handler) fiber.Handler

JSONOnly allow json requests only

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,
	callback fiber.Handler,
	methods []string,
	ignore []string,
) 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