Documentation ¶
Index ¶
Constants ¶
View Source
const ( CITY = "GeoLite2-City" COUNTRY = "Geolite2-Country" )
Variables ¶
View Source
var DbLocations = []string{
"/etc/evebox/GeoLite2-City.mmdb.gz",
"/etc/evebox/GeoLite2-City.mmdb",
"/usr/local/share/GeoIP/GeoLite2-City.mmdb",
"/usr/share/GeoIP/GeoLite2-City.mmdb",
}
Functions ¶
func FindDbPath ¶
func FindDbPath() string
Types ¶
type GeoIp ¶
type GeoIp struct { Ip string `json:"ip,omitempty"` Ip6 string `json:"ip6,omitempty"` ContinentCode string `json:"continent_code,omitempty"` CountryCode2 string `json:"country_code2,omitempty"` CountryName string `json:"country_name,omitempty"` RegionName string `json:"region_name,omitempty"` RegionCode string `json:"region_code,omitempty"` CityName string `json:"city_name,omitempty"` Latitude float64 `json:"latitude,omitempty"` Longitude float64 `json:"longitude,omitempty"` Coordinates [2]float64 `json:"coordinates,omitempty"` }
type GeoIpService ¶
type GeoIpService struct {
// contains filtered or unexported fields
}
func NewGeoIpService ¶
func NewGeoIpService() *GeoIpService
func (*GeoIpService) LookupString ¶
func (s *GeoIpService) LookupString(addr string) (*GeoIp, error)
Click to show internal directories.
Click to hide internal directories.