maxmind

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EIDGeoIP2City         = EditionID("GeoIP2-City")
	EIDGeoIP2CityCSV      = EditionID("GeoIP2-City-CSV")
	EIDGeoIP2Country      = EditionID("GeoIP2-Country")
	EIDGeoIP2CountryCSV   = EditionID("GeoIP2-Country-CSV")
	EIDGeoLite2ASN        = EditionID("GeoLite2-ASN")
	EIDGeoLite2ASNCSV     = EditionID("GeoLite2-ASN-CSV")
	EIDGeoLite2City       = EditionID("GeoLite2-City")
	EIDGeoLite2CityCSV    = EditionID("GeoLite2-City-CSV")
	EIDGeoLite2Country    = EditionID("GeoLite2-Country")
	EIDGeoLite2CountryCSV = EditionID("GeoLite2-Country-CSV")
)

Edition ID enum

View Source
const (
	SfxTarGz = Suffix("tar.gz")
	SfxZip   = Suffix("zip")
)

Suffix enum

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client represents an active maxmind object

func New

func New(config Config) (*Client, error)

New returns a maxmind client

func (*Client) NewDownloader added in v0.2.1

func (c *Client) NewDownloader(eid EditionID, dlDir string) (*Downloader, error)

NewDownloader returns a new downloader instance

type Config

type Config struct {
	Logger     zerolog.Logger
	LicenseKey string
	BaseURL    string
	UserAgent  string
}

Config defines the config for maxmind

type Downloader added in v0.2.1

type Downloader struct {
	*Client
	// contains filtered or unexported fields
}

Downloader represents an active downloader object

func (*Downloader) Download added in v0.2.1

func (d *Downloader) Download() ([]os.FileInfo, error)

Download downloads a database

type EditionID

type EditionID string

EditionID represents the edition ID of a database

func GetEditionID

func GetEditionID(eidStr string) (EditionID, error)

GetEditionID returns an edition ID from string

func (EditionID) Filename

func (eid EditionID) Filename() string

Filename returns the filename of an edition ID

func (EditionID) String

func (eid EditionID) String() string

String returns the string representation of an edition ID

func (EditionID) Suffix

func (eid EditionID) Suffix() Suffix

Suffix returns the suffix linked of an edition ID

type Suffix

type Suffix string

Suffix represents the suffix of a database

func (Suffix) String

func (sfx Suffix) String() string

String returns the string representation of a suffix

Jump to

Keyboard shortcuts

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