auth

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2022 License: Apache-2.0 Imports: 5 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidMiddlewareName    = errors.New("invalid or empty auth middleware name")
	ErrMiddlewareAlreadyExists  = errors.New("auth middleware already exists")
	ErrNilMiddleware            = errors.New("auth middleware is nil")
	ErrInvalidConfig            = errors.New("middleware config must be a non-nil pointer to a struct")
	ErrMiddlewareNotFound       = errors.New("auth middleware not found")
	ErrMiddlewareConfigNotFound = errors.New("auth middleware config not found")
)

Functions

func NamedMiddlewareAs

func NamedMiddlewareAs[T Middleware](nmw NamedMiddleware) T

func RegisterMiddleware

func RegisterMiddleware(name string, m Middleware) error

func ResetMiddlewares

func ResetMiddlewares()

Types

type Middleware

type Middleware interface {
	Description() string
	Handle(*fiber.Ctx) error
}

type NamedMiddleware

type NamedMiddleware interface {
	Middleware
	Name() string
}

func GetMiddleware

func GetMiddleware(name string) (NamedMiddleware, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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