middleware

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2025 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAuthUserParser

func AddAuthUserParser(jwtSecret string) func(fiber.Ctx) error

func AddBodyValidator

func AddBodyValidator[T any]() fiber.Handler

func AddCors

func AddCors() func(fiber.Ctx) error

func AddIncomingTrafficLogger

func AddIncomingTrafficLogger(logger *slog.Logger) fiber.Handler

func AddLocalsContextLogger

func AddLocalsContextLogger(logger *slog.Logger) fiber.Handler

func AddParamsValidator

func AddParamsValidator[T any]() fiber.Handler

func AddQueryValidator

func AddQueryValidator[T any]() fiber.Handler

func AddRateLimiter

func AddRateLimiter(limit int, expiration time.Duration) func(fiber.Ctx) error

func AddUnauthorizedRateLimiter

func AddUnauthorizedRateLimiter(limit int, expiration time.Duration) func(fiber.Ctx) error

func FallbackHandler

func FallbackHandler(c fiber.Ctx, err error) error

func RequireAuth

func RequireAuth(targetRole types.UserRole) func(fiber.Ctx) error

Types

type Validator

type Validator interface {
	Validate() error
}

Jump to

Keyboard shortcuts

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