dbip

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Overview

Package dbip provides columns for the DBIP database.

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(t *GeoColumnFactory) schema.EventColumn

CityColumn creates a city column from a MMDB path.

func ContinentColumn

func ContinentColumn(t *GeoColumnFactory) schema.EventColumn

ContinentColumn creates a continent column from a MMDB path.

func CountryColumn

func CountryColumn(t *GeoColumnFactory) schema.EventColumn

CountryColumn creates a country column from a MMDB path.

func GeoColumns

func GeoColumns(
	downloader Downloader,
	destinationDirectory string,
	downloadTimeout time.Duration,
	cacheConfig CacheConfig,
) []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(t *GeoColumnFactory) schema.EventColumn

RegionColumn creates a region column from a MMDB path.

Types

type CacheConfig added in v0.7.0

type CacheConfig struct {
	MaxEntries int64
	TTL        time.Duration
}

CacheConfig is the configuration for the cache.

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 GeoColumnFactory added in v0.7.0

type GeoColumnFactory struct {
	// contains filtered or unexported fields
}

GeoColumnFactory is a template for creating geo columns.

func NewGeoColumnFactory added in v0.7.0

func NewGeoColumnFactory(mmdbPath string, cacheConfig CacheConfig) (*GeoColumnFactory, error)

NewGeoColumnFactory creates a new GeoColumnTemplate.

func (*GeoColumnFactory) Column added in v0.7.0

func (t *GeoColumnFactory) Column(
	column schema.InterfaceID,
	field *arrow.Field,
	getValue func(event *schema.Event, record *result) (any, schema.D8AColumnWriteError),
	options ...columns.EventColumnOptions,
) schema.EventColumn

Column creates a new event column from a GeoColumnTemplate.

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