middleware

package
v2.2.12 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BackendKey = "GetterBackend"
)

Variables

This section is empty.

Functions

func AddHeader

func AddHeader(backend model.Backend) echo.MiddlewareFunc

func Backend

func Backend(b model.Backend) echo.MiddlewareFunc

func IPFilterWithConfig added in v2.2.9

func IPFilterWithConfig(config IPFilterConfig) echo.MiddlewareFunc

func TokenAuthWithConfig

func TokenAuthWithConfig(config TokenAuthConfig) echo.MiddlewareFunc

TokenAuthWithConfig returns an TokenAuth middleware with config. See `TokenAuth()`.

Types

type IPFilterConfig added in v2.2.9

type IPFilterConfig struct {
	AllowIPs []string
	Logger   *log.Logger
}

type TokenAuthConfig

type TokenAuthConfig struct {
	// Skipper defines a function to skip middleware.
	Skipper middleware.Skipper

	// Validator is a function to validate TokenAuth credentials.
	// Required.
	Validator TokenAuthValidator
}

TokenAuthConfig defines the config for TokenAuth middleware.

type TokenAuthValidator

type TokenAuthValidator func(string) bool

TokenAuthValidator defines a function to validate TokenAuth credentials.

Jump to

Keyboard shortcuts

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