Documentation
¶
Overview ¶
Package geo pkg/geo/geo.go c0-com-util
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrIPIsNotPublic = errors.New("ip address is not public") ErrCannotObtainLocFromIP = errors.New("cannot obtain location from IP") )
Errors associated with geo calls.
Functions ¶
This section is empty.
Types ¶
type LocationData ¶
type LocationData struct {
Lat float64 `json:"lat,omitempty"`
Lon float64 `json:"lon,omitempty"`
Country string `json:"country,omitempty"`
Region string `json:"region,omitempty"`
}
LocationData represents a geolocation point.
type LocationDetails ¶
type LocationDetails func(ip net.IP) (*LocationData, error)
LocationDetails represents a function that obtains geolocation from a given IP.
func MakeIPDetails ¶
func MakeIPDetails(log logrus.FieldLogger, geoip string) LocationDetails
MakeIPDetails returns a GeoFunc.
Click to show internal directories.
Click to hide internal directories.