Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Geo ¶
type Geo struct {
// contains filtered or unexported fields
}
Geo is an implemention of Handler interface
func (*Geo) GetGeoInfo ¶
GetGeoInfo implement Handler interface note: always return a non-nil *GeoInfo
type GeoInfo ¶
type GeoInfo struct {
IP string `json:"ip" bson:"ip"`
Continent string `json:"continent" bson:"continent"`
Country string `json:"country" bson:"country"`
CountryISO string `json:"country_iso" bson:"country_iso"`
City string `json:"city" bson:"city"`
TimeZone string `json:"timezone" bson:"timezone"`
Orgnization string `json:"orgnization" bson:"orgnization"`
}
GeoInfo is exported
type Handler ¶
type Handler interface {
GetGeoInfo(addr, lang string) *GeoInfo // query geo info for given address & lang["de","en","es","fr","ja","pt-BR","ru","zh-CN"]
Metadata() map[string]maxminddb.Metadata // current geo data info (version,epoch,size,lang,etc)
Update() error // update geo data
}
Handler represents geo data interface
Click to show internal directories.
Click to hide internal directories.