Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadMaxmindDB ¶
func LoadMaxmindDB(path string)
LoadMaxmindDB loads a MaxMind DB into memory for use by the /lookup endpoint.
func UnloadMaxmindDB ¶
func UnloadMaxmindDB()
UnloadMaxmindDB unloads the MaxMind DB from memory. This is just for testing.
Types ¶
type LookupResponse ¶
type LookupResponse struct { CountryCode string `json:"country_code"` Country string `json:"country"` RegionCode *string `json:"region_code"` City string `json:"city"` ContinentCode string `json:"continent_code"` Continent string `json:"continent"` Location Location `json:"location"` }
Response is a struct that holds the data for the JSON HTTP response body.
func LookupIP ¶
func LookupIP(ip string) (*LookupResponse, error)
LookupIP looks up the specified IP in the loaded Maxmind DB
type MultiLookupResponse ¶
type MultiLookupResponse map[string]interface{}
func MultiLookupIP ¶
func MultiLookupIP(ips []string) (*MultiLookupResponse, error)
Click to show internal directories.
Click to hide internal directories.