Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { ConfigBucket string IPCity Keypath IPASN Keypath UpdateFrequencyMins int JitterSecs int }
Config defines how a GeoLookup should be kept updated.
type GeoLookup ¶
type GeoLookup interface { GetRegion(string) string GetCountry(string) string GetCity(string) string GetAsn(string) string Reload() error }
GeoLookup defines functions to get properties of an IP address and Reload databases.
type GeoMMIP ¶
GeoMMIP is a GeoLookup backed by MaxMind. Can build out a cache maybe?
func NewGeoMMIp ¶
NewGeoMMIp returns a GeoMMIP using the given geo and asn database locations.
func (*GeoMMIP) GetCountry ¶
GetCountry returns the country associated with the ip.
type NoopGeoIP ¶
type NoopGeoIP struct{}
NoopGeoIP is a GeoLookup that always returns empty strings.
func (*NoopGeoIP) GetCountry ¶
GetCountry returns an empty string.
type Updater ¶
type Updater struct {
// contains filtered or unexported fields
}
Updater keeps a GeoLookup's databases updated.
func NewUpdater ¶
NewUpdater returns a new Updater for the given GeoLookup.
func (*Updater) UpdateLoop ¶
func (u *Updater) UpdateLoop()
UpdateLoop is a blocking function that updates the GeoLookup on a recurring basis.
Click to show internal directories.
Click to hide internal directories.