Documentation ¶
Overview ¶
Package geoipupdate provides a library for using MaxMind's GeoIP Update service.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { GetReader func() (database.Reader, error) // contains filtered or unexported fields }
Client uses config data to initiate a download or update process for GeoIP databases.
type Config ¶
type Config struct { // AccountID is the account ID. AccountID int // DatabaseDirectory is where database files are going to be // stored. DatabaseDirectory string // EditionIDs are the database editions to be updated. EditionIDs []string // LicenseKey is the license attached to the account. LicenseKey string // LockFile is the path of a lock file that ensures that only one // geoipupdate process can run at a time. LockFile string // PreserveFileTimes sets whether database modification times // are preserved across downloads. PreserveFileTimes bool // Parallelism defines the number of concurrent downloads that // can be triggered at the same time. It defaults to 1, which // wouldn't change the existing behaviour of downloading files // sequentially. Parallelism int // Proxy is host name or IP address of a proxy server. Proxy *url.URL // RetryFor is the retry timeout for HTTP requests. It defaults // to 5 minutes. RetryFor time.Duration // URL points to maxmind servers. URL string // Verbose turns on debug statements. Verbose bool // Output turns on sending the download/update result to stdout as JSON. Output bool // contains filtered or unexported fields }
Config is a parsed configuration file.
type Option ¶
Option is a function type that modifies a configuration object. It is used to define functions that override a config with values set as command line arguments.
func WithConfigFile ¶
WithConfigFile returns an Option that sets the configuration file to be used.
func WithDatabaseDirectory ¶
WithDatabaseDirectory returns an Option that sets the DatabaseDirectory value of a config.
func WithOutput ¶
WithOutput returns an Option that sets the Output value of a config.
func WithParallelism ¶
WithParallelism returns an Option that sets the Parallelism value of a config.
func WithVerbose ¶
WithVerbose returns an Option that sets the Verbose value of a config.
Directories ¶
Path | Synopsis |
---|---|
Package database provides an abstraction over getting and writing a database file.
|
Package database provides an abstraction over getting and writing a database file. |
Package internal provides internal structures.
|
Package internal provides internal structures. |
Package vars hold random vars, consts and defaults.
|
Package vars hold random vars, consts and defaults. |