Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConfig = Config{ Skipper: middleware.DefaultSkipper, BlockByDefault: false, }
DefaultConfig is the default IPFilter middleware config
Functions ¶
func Middleware ¶
func Middleware() echo.MiddlewareFunc
Middleware returns an IPFilter middleware to filter requests by ip matching / blocking.
func MiddlewareWithConfig ¶
func MiddlewareWithConfig(config Config) echo.MiddlewareFunc
MiddlewareWithConfig returns an IPFilter middleware with config. See: `IPFilter()`.
Types ¶
type Config ¶
type Config struct { // Skipper defines a function to skip middleware. // default middleware.DefaultSkipper Skipper middleware.Skipper // WhiteList is an allowed ip list. WhiteList []string // BlackList is a disallowed ip list. BlackList []string // Block by default. BlockByDefault bool }
Config defines the config for IPFilter middleware.
Click to show internal directories.
Click to hide internal directories.