middlewares

package
v0.0.0-...-f43e618 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AcceptsJSON = Accepts("application/json")

Functions

func Accepts

func Accepts(mimes ...string) func(ctx *fiber.Ctx) error

func Chained

func Chained(app *fiber.App, middlewares ...fiber.Handler)

func EnrichSentry

func EnrichSentry() func(ctx *fiber.Ctx) error

func Idempotency

func Idempotency(config *IdempotencyConfig) fiber.Handler

func InjectI18n

func InjectI18n() func(c *fiber.Ctx) error

func InjectValidBody

func InjectValidBody[T any]() func(*fiber.Ctx) error

func Logger

func Logger(app *fiber.App)

func RequestID

func RequestID() fiber.Handler

func ValidateCategoryAsParam

func ValidateCategoryAsParam(c *fiber.Ctx) error

func ValidateServerAsParam

func ValidateServerAsParam(c *fiber.Ctx) error

func ValidateServerAsQuery

func ValidateServerAsQuery(c *fiber.Ctx) error

Types

type IdempotencyConfig

type IdempotencyConfig struct {
	// Lifetime is the maximum lifetime of an idempotency key.
	Lifetime time.Duration

	// KeyHeader is the name of the header that contains the idempotency key.
	KeyHeader string

	// KeepResponseHeaders is a list of headers that should be kept from the original response.
	// By default, all headers are kept.
	KeepResponseHeaders []string

	// Storage is the storage backend for the idempotency key & its response data.
	Storage fiber.Storage

	RedSync *redsync.Redsync

	// Next defines a function to skip this middleware when returned true.
	//
	// Optional. Default: nil
	Next func(c *fiber.Ctx) bool
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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