Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GeoIP ¶
type GeoIP struct {
// The AccountID of the maxmind account
AccountID int `json:"account_id"`
// The API Key used to download the latest file
APIKey string `json:"api_key"`
// The path of the MaxMind GeoLite2-Country.mmdb file.
DbPath string `json:"db_path"`
// The frequency to download a fresh version of the database file
DownloadFrequency caddy.Duration `json:"download_frequency"`
// The frequency to reload the database file
ReloadFrequency caddy.Duration `json:"reload_frequency"`
// The header to trust instead of the `RemoteAddr`
TrustHeader string `json:"trust_header"`
// The Country Code to set if no value could be found
OverrideCountryCode string `json:"override_country_code"`
// contains filtered or unexported fields
}
Allows finding the Country Code of an IP address using the Maxmind database
func (GeoIP) CaddyModule ¶
func (GeoIP) CaddyModule() caddy.ModuleInfo
type Record ¶
type Record struct {
Country Country `maxminddb:"country"`
Location Location `maxminddb:"location"`
Subdivisions Subdivisions `maxminddb:"subdivisions"`
}
type Subdivision ¶
type Subdivision struct {
ISOCode string `maxminddb:"iso_code"`
}
type Subdivisions ¶
type Subdivisions []Subdivision
func (Subdivisions) CommaSeparatedISOCodes ¶
func (s Subdivisions) CommaSeparatedISOCodes() string
func (Subdivisions) GetISOCodes ¶
func (s Subdivisions) GetISOCodes() []string
Click to show internal directories.
Click to hide internal directories.