Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnablePersistence ¶
func EnablePersistence(geoFile string)
EnablePersistence enables persistence of the current geo info to disk at the named file and initializes current geo info from that file if necessary.
func GetCountry ¶
GetCountry gets the country. If the country hasn't been determined yet, waits up to the given timeout for a country to become available.
func GetIP ¶
GetIP gets the IP. If the IP hasn't been determined yet, waits up to the given timeout for an IP to become available.
func OnRefresh ¶
func OnRefresh() <-chan bool
OnRefresh creates a channel that caller can receive on when new geolocation information is got.
func Refresh ¶
func Refresh()
Refresh refreshes the geolookup information by calling the remote geolookup service. It will keep calling the service until it's able to determine an IP and country.
func SetDefaultRoundTripper ¶
func SetDefaultRoundTripper()