Documentation ¶
Index ¶
- func AppendAllRIRSubnets(mmdb *maxminddb.Reader, entries map[string]string, rirFiles []string, ...) error
- func CountrySliceToMap(cc []string) (countries map[string]struct{})
- func GetDBReader(filename string) (*maxminddb.Reader, error)
- func GetMMDBFile(dir, license string) (filename string, err error)
- func GetMMDBSubnets(mmdb *maxminddb.Reader, entries map[string]string, isIPv4Only, lowercase bool, ...) error
- func GetRIRFiles(dir string) (filenames []string, err error)
- func WriteI2C(entries map[string]string, outfile, tmpDir string) (err error)
- type Record
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendAllRIRSubnets ¶
func AppendAllRIRSubnets(mmdb *maxminddb.Reader, entries map[string]string, rirFiles []string, isIPv4Only, lowercase bool, includeCountries, excludeCountries map[string]struct{}) error
AppendAllRIRSubnets uses RIR entries to add missing records to the MaxMind database
func CountrySliceToMap ¶
CountrySliceToMap converts a slice to a map for faster lookups
func GetDBReader ¶
GetDBReader opens the mmdb file
func GetMMDBFile ¶
GetMMDBFile extracts the mmdb file. The provided directory serves as a working directory and is intended to be used with a directory created using ioutil.TempDir
func GetMMDBSubnets ¶
func GetMMDBSubnets(mmdb *maxminddb.Reader, entries map[string]string, isIPv4Only, lowercase bool, includeCountries, excludeCountries map[string]struct{}) error
GetMMDBSubnets extracts subnets from the given MaxMind database
func GetRIRFiles ¶
GetRIRFiles downloads all RIR files concurrently and returns the list of downloaded files. The provided directory serves as a working directory and is intended to be used with a directory created using ioutil.TempDir
Types ¶
type Record ¶
type Record struct { Country struct { IsoCode string `maxminddb:"iso_code"` } `maxminddb:"country"` RegisteredCountry struct { IsoCode string `maxminddb:"iso_code"` } `maxminddb:"registered_country"` IsAnonymousProxy bool `maxminddb:"is_anonymous_proxy"` IsSatelliteProvider bool `maxminddb:"is_satellite_provider"` }
Record describes a MaxMind DB record entry with only Country fields