Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Setup ¶
func Setup(c *setup.Controller) (middleware.Middleware, error)
Setup parses the ipfilter configuration and returns the middleware handler
Types ¶
type IPFConfig ¶
type IPFConfig struct { PathScopes []string Rule string BlockPage string CountryCodes []string Ranges []Range DBHandler *maxminddb.Reader // Database's handler if it gets opened }
IPFConfig holds the configuration for the ipfilter middleware
type IPFilter ¶
type IPFilter struct { Next middleware.Handler Config IPFConfig }
IPFilter is a middleware for filtering clients based on their ip or country's ISO code;
type OnlyCountry ¶
type OnlyCountry struct { Country struct { ISOCode string `maxminddb:"iso_code"` } `maxminddb:"country"` }
OnlyCountry is used to fetch only the country's code from 'mmdb'
Click to show internal directories.
Click to hide internal directories.