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 ¶
func WithVerbose ¶
WithVerbose enable verbose output for the config.
Types ¶
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 behavior 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 WithParallelism ¶
WithParallelism returns an Option that sets the Parallelism value of a config.
type Updater ¶
type Updater struct {
// contains filtered or unexported fields
}
Updater uses config data to initiate a download or update process for GeoIP databases.
func NewUpdater ¶
NewUpdater initialized a new Updater struct.