middleware

package
v0.0.0-...-9a2df54 Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthRequired

func AuthRequired() fiber.Handler

func Cors

func Cors() func(*fiber.Ctx) error

func ErrorHandler

func ErrorHandler(log logger.Interface) fiber.Handler

func ExtractTokenFromHeader

func ExtractTokenFromHeader(ctx *fiber.Ctx) (string, error)

ExtractTokenFromHeader from a header

func IdentityFromContext

func IdentityFromContext(ctx *fiber.Ctx) any

IdentityFromContext gets the user identity from a context

func IdentityInContext

func IdentityInContext(ctx *fiber.Ctx, identity any)

IdentityInContext: Places the user identity in a context

func MwValidateBody

func MwValidateBody[bodyType any](c *fiber.Ctx) error

MwValidateBody performs same function as ParseAndValidate but this is a middleware

func ParseAndValidate

func ParseAndValidate(ctx *fiber.Ctx, payloadPtr any) error

ParseAndValidate performs the work of both PARSEBODY and VALIDATEBODY

func ParseBody

func ParseBody(c *fiber.Ctx, payloadPtr any) error

ParseBody reads either a json or xml or html forms or urls body and then parse to a struct. After which if there is an error it detects error type

func RequestID

func RequestID() fiber.Handler

func TimeTakenToProcessEndpoint

func TimeTakenToProcessEndpoint() fiber.Handler

func ValidateBody

func ValidateBody(payloadPtr any) error

ValidateBody validates a struct and returns error if any found

func ValidateToken

func ValidateToken(token string) (bool, error)

ValidateToken validates a token

func ValidatedDataFromContext

func ValidatedDataFromContext(ctx *fiber.Ctx) (val any)

ValidatedDataFromContext(c).(*type)

Types

This section is empty.

Jump to

Keyboard shortcuts

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