provider

package
v0.114.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoMetadataFound = errors.New("no geo IP metadata found")

ErrNoMetadataFound error should be returned when a provider could not find the corresponding IP metadata

Functions

This section is empty.

Types

type Config added in v0.104.0

type Config interface {
	component.ConfigValidator
}

Config is the configuration of a GeoIPProvider.

type GeoIPProvider

type GeoIPProvider interface {
	// Location returns a set of attributes representing the geographical location for the given IP address. It requires a context for managing request lifetime.
	Location(context.Context, net.IP) (attribute.Set, error)
}

GeoIPProvider defines methods for obtaining the geographical location based on the provided IP address.

type GeoIPProviderFactory added in v0.105.0

type GeoIPProviderFactory interface {
	// CreateDefaultConfig creates the default configuration for the GeoIPProvider.
	CreateDefaultConfig() Config

	// CreateGeoIPProvider creates a provider based on this config. Processor's settings are provided as an argument to initialize the logger if needed.
	CreateGeoIPProvider(ctx context.Context, settings processor.Settings, cfg Config) (GeoIPProvider, error)
}

GeoIPProviderFactory can create GeoIPProvider instances.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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