Documentation ¶
Index ¶
- func InitGeoIPFilter(h interface{}, cfgData map[string]interface{}, callNo int) (err error)
- type GeoIPFilterType
- func (hdlr *GeoIPFilterType) InitializeWithConfigData(next http.Handler, gCfg *cfg.ServerGlobalConfigType, serverName string, ...) (err error)
- func (hdlr *GeoIPFilterType) MatchCountryCode(isocode string) bool
- func (hdlr *GeoIPFilterType) PreValidate(gCfg *cfg.ServerGlobalConfigType, cfgData map[string]interface{}, ...) (err error)
- func (hdlr *GeoIPFilterType) ServeHTTP(www http.ResponseWriter, req *http.Request)
- type OnlyCountryCode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitGeoIPFilter ¶
Types ¶
type GeoIPFilterType ¶
type GeoIPFilterType struct { Next http.Handler Paths []string Action string // reject, allow CountryCodes []string PageIfBlocked string DBFileName string LineNo int // contains filtered or unexported fields }
func NewGeoIPFilterServer ¶
func (*GeoIPFilterType) InitializeWithConfigData ¶
func (hdlr *GeoIPFilterType) InitializeWithConfigData(next http.Handler, gCfg *cfg.ServerGlobalConfigType, serverName string, pNo, callNo int) (err error)
func (*GeoIPFilterType) MatchCountryCode ¶
func (hdlr *GeoIPFilterType) MatchCountryCode(isocode string) bool
func (*GeoIPFilterType) PreValidate ¶
func (hdlr *GeoIPFilterType) PreValidate(gCfg *cfg.ServerGlobalConfigType, cfgData map[string]interface{}, serverName string, pNo, callNo int) (err error)
func (*GeoIPFilterType) ServeHTTP ¶
func (hdlr *GeoIPFilterType) ServeHTTP(www http.ResponseWriter, req *http.Request)
type OnlyCountryCode ¶
type OnlyCountryCode struct { Country struct { ISOCode string `maxminddb:"iso_code"` } `maxminddb:"country"` }
This is drectly from the example code
Click to show internal directories.
Click to hide internal directories.