Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var FastCacheCache = fastcache.New(32000000)
Functions ¶
func AddLocation ¶
func AddLocation(query string, location ip_api.Location, expirationDuration time.Duration) (bool, error)
AddLocation - adds a query + location to cache map along with an expiration time query - IP/DNS value location - ip_api location expirationDuration - duration in which the query will expire (go stale)
func GetLocation ¶
GetLocation - function for getting the location of a query from cache query - IP/DNS entry fields - string of comma separated values returns ip_api Location error
func ReadCache ¶
func ReadCache(writeLocation *string)
ReadCache - reads the cache file from disk and loads it into the Cache map writeLocation - string containing the file path.
func WriteCache ¶
func WriteCache(writeLocation *string)
WriteCache - writes the cache to a file on disk to be read on app restarts writeLocation - string containing the write path
Types ¶
Click to show internal directories.
Click to hide internal directories.