geoip

package
v0.0.156 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Enabled bool `yaml:"enabled" default:"false"`
	Type    Type `yaml:"type" default:"maxmind"`

	Config *RawMessage `yaml:"config"`
}

func (*Config) Validate

func (c *Config) Validate() error

type Provider

type Provider interface {
	Start(ctx context.Context) error
	Stop(ctx context.Context) error
	Type() string
	LookupIP(ctx context.Context, ip net.IP) (*lookup.Result, error)
}

func NewProvider

func NewProvider(providerType Type, config *RawMessage, log logrus.FieldLogger) (Provider, error)

type RawMessage

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

func (*RawMessage) Unmarshal

func (r *RawMessage) Unmarshal(v interface{}) error

func (*RawMessage) UnmarshalYAML

func (r *RawMessage) UnmarshalYAML(unmarshal func(interface{}) error) error

type Type

type Type string
const (
	TypeUnknown Type = "unknown"
	TypeMaxmind Type = maxmind.Type
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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