Documentation
¶
Overview ¶
Package dbip provides utilities to download DB-IP datasets from an OCI registry.
Index ¶
- func CityColumn(mmdbPath string) schema.EventColumn
- func ContinentColumn(mmdbPath string) schema.EventColumn
- func CountryColumn(mmdbPath string) schema.EventColumn
- func GeoColumns(downloader Downloader, destinationDirectory string, ...) []schema.EventColumn
- func GetMaxmindReader(mmdbPath string) (*maxminddb.Reader, error)
- func RegionColumn(mmdbPath string) schema.EventColumn
- type Downloader
- type OCIRegistryCreds
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CityColumn ¶
func CityColumn(mmdbPath string) schema.EventColumn
CityColumn creates a city column from a MMDB path.
func ContinentColumn ¶
func ContinentColumn(mmdbPath string) schema.EventColumn
ContinentColumn creates a continent column from a MMDB path.
func CountryColumn ¶
func CountryColumn(mmdbPath string) schema.EventColumn
CountryColumn creates a country column from a MMDB path.
func GeoColumns ¶
func GeoColumns( downloader Downloader, destinationDirectory string, downloadTimeout time.Duration, ) []schema.EventColumn
GeoColumns creates a set of geo columns from a downloader.
func GetMaxmindReader ¶
GetMaxmindReader returns a cached maxminddb.Reader for the given MMDB path.
func RegionColumn ¶
func RegionColumn(mmdbPath string) schema.EventColumn
RegionColumn creates a region column from a MMDB path.
Types ¶
type Downloader ¶
type Downloader interface {
// Download obtains the MMDB city database and returns the path to the downloaded file
Download(ctx context.Context, artifactName, tag, destinationDir string) (string, error)
}
Downloader downloads an MMDB city database and returns the saved file path.
func NewExtensionBasedOCIDownloader ¶
func NewExtensionBasedOCIDownloader(creds OCIRegistryCreds, extension string) Downloader
NewExtensionBasedOCIDownloader creates a new MMDBCityDatabaseDownloader backed by an OCI registry
func NewOnlyOnceDownloader ¶
func NewOnlyOnceDownloader(downloader Downloader) Downloader
NewOnlyOnceDownloader creates a new OnlyOnceDownloader