Documentation ¶
Index ¶
- Constants
- func CheckFileExists(filePath string) (exists bool, err error)
- func ExtractASN(zipPath, dest string) error
- func ExtractCity(zipPath, dest string) error
- func ExtractCountry(zipPath, dest string) error
- func UnzipFiles(src, dest string) error
- type FetchASNFilesOutput
- type FetchCityFilesOutput
- type FetchCountryFilesOutput
- type FetchFilesInput
- type FetchFilesOutput
- type GeoIP
- func (gc *GeoIP) FetchASNFiles() (output FetchASNFilesOutput, err error)
- func (gc *GeoIP) FetchAllFiles() (output FetchFilesOutput, err error)
- func (gc *GeoIP) FetchCityFiles() (output FetchCityFilesOutput, err error)
- func (gc *GeoIP) FetchCountryFiles() (output FetchCountryFilesOutput, err error)
- func (gc *GeoIP) FetchFile(dbName string) (filePath string, err error)
- func (gc *GeoIP) FetchFileName(dbName string) (filename string, err error)
- func (gc *GeoIP) FetchFiles(input FetchFilesInput) (output FetchFilesOutput, err error)
- func (gc *GeoIP) Validate() error
- type LeveledLogrus
Constants ¶
View Source
const ( DownloadScheme = "https" DownloadHost = "download.maxmind.com" DownloadPath = "/app/geoip_download" NameASN = "ASN" NameCountry = "Country" NameCity = "City" GeoLite2CityBlocksIPv4CSVFileName = "GeoLite2-City-Blocks-IPv4.csv" GeoLite2CityBlocksIPv6CSVFileName = "GeoLite2-City-Blocks-IPv6.csv" GeoLite2CityLocationsEnCSVFileName = "GeoLite2-City-Locations-en.csv" GeoLite2ASNBlocksIPv4CSVFileName = "GeoLite2-ASN-Blocks-IPv4.csv" GeoLite2ASNBlocksIPv6CSVFileName = "GeoLite2-ASN-Blocks-IPv6.csv" GeoLite2CountryBlocksIPv4CSVFileName = "GeoLite2-Country-Blocks-IPv4.csv" GeoLite2CountryBlocksIPv6CSVFileName = "GeoLite2-Country-Blocks-IPv6.csv" GeoLite2CountryLocationsEnCSVFileName = "GeoLite2-Country-Locations-en.csv" )
Variables ¶
This section is empty.
Functions ¶
func CheckFileExists ¶
func ExtractASN ¶
func ExtractCity ¶
func ExtractCountry ¶
func UnzipFiles ¶
Types ¶
type FetchASNFilesOutput ¶
type FetchCityFilesOutput ¶
type FetchCountryFilesOutput ¶
type FetchFilesInput ¶
type FetchFilesOutput ¶
type FetchFilesOutput struct { ASNVersion string ASNCompressedFilePath string ASNIPv4FilePath string ASNIPv6FilePath string ASNDataPath string CityVersion string CityIPv4FilePath string CityIPv6FilePath string CityLocationsFilePath string CityCompressedFilePath string CityDataPath string CountryVersion string CountryIPv4FilePath string CountryIPv6FilePath string CountryLocationsFilePath string CountryCompressedFilePath string CountryDataPath string }
type GeoIP ¶
type GeoIP struct { Client *retryablehttp.Client LicenseKey string Root string Edition string DBFormat string // mmdb or csv Extract bool Replace bool }
func (*GeoIP) FetchASNFiles ¶
func (gc *GeoIP) FetchASNFiles() (output FetchASNFilesOutput, err error)
func (*GeoIP) FetchAllFiles ¶
func (gc *GeoIP) FetchAllFiles() (output FetchFilesOutput, err error)
func (*GeoIP) FetchCityFiles ¶
func (gc *GeoIP) FetchCityFiles() (output FetchCityFilesOutput, err error)
func (*GeoIP) FetchCountryFiles ¶
func (gc *GeoIP) FetchCountryFiles() (output FetchCountryFilesOutput, err error)
func (*GeoIP) FetchFileName ¶
func (*GeoIP) FetchFiles ¶
func (gc *GeoIP) FetchFiles(input FetchFilesInput) (output FetchFilesOutput, err error)
type LeveledLogrus ¶
Click to show internal directories.
Click to hide internal directories.