Help us shape the future of Go! Take the 2026 Go Developer Survey

dbip

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2025 License: MIT Imports: 23 Imported by: 0

Documentation

Overview

Package dbip provides utilities to download DB-IP datasets from an OCI registry.

Index

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

func GetMaxmindReader(mmdbPath string) (*maxminddb.Reader, error)

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

type OCIRegistryCreds

type OCIRegistryCreds struct {
	User     string
	Password string
	Repo     string

	IgnoreCert bool
}

OCIRegistryCreds contains credentials and settings for accessing an OCI registry.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL