Documentation
¶
Overview ¶
Package config provides configuration management for the MaxMindDB MCP server.
Index ¶
Constants ¶
const ( ModeMaxMind = "maxmind" ModeDirectory = "directory" ModeGeoIPCompat = "geoip_compat" )
Mode constants for configuration.
Variables ¶
This section is empty.
Functions ¶
func DefaultGeoIPPaths ¶
func DefaultGeoIPPaths() []string
DefaultGeoIPPaths returns the default paths where GeoIP.conf might be located.
func GenerateDefaultTOMLConfig ¶
GenerateDefaultTOMLConfig creates a default TOML config file.
func SaveTOMLConfig ¶
SaveTOMLConfig saves configuration to a TOML file.
Types ¶
type Config ¶
type Config struct {
GeoIPCompat GeoIPCompatConfig `toml:"geoip_compat"`
Mode string `toml:"mode"`
UpdateInterval string `toml:"update_interval"`
IteratorTTL string `toml:"iterator_ttl"`
IteratorCleanupInterval string `toml:"iterator_cleanup_interval"`
Directory DirectoryConfig `toml:"directory"`
MaxMind MaxMindConfig `toml:"maxmind"`
UpdateIntervalDuration time.Duration `toml:"-"`
IteratorTTLDuration time.Duration `toml:"-"`
IteratorCleanupIntervalDuration time.Duration `toml:"-"`
AutoUpdate bool `toml:"auto_update"`
}
Config represents the application configuration.
func ConvertGeoIPToTOML ¶
ConvertGeoIPToTOML converts a GeoIP.conf file to TOML format.
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns a configuration with default values.
func LoadConfig ¶
LoadConfig loads configuration from a TOML file.
func (*Config) ExpandPaths ¶
ExpandPaths expands ~ in file paths to the user's home directory.
type DirectoryConfig ¶
type DirectoryConfig struct {
Paths []string `toml:"paths"`
}
DirectoryConfig holds configuration for directory mode.
type GeoIPCompatConfig ¶
type GeoIPCompatConfig struct {
ConfigPath string `toml:"config_path"`
DatabaseDir string `toml:"database_dir"`
}
GeoIPCompatConfig holds configuration for GeoIP.conf compatibility.
type GeoIPConfig ¶
type GeoIPConfig struct {
LicenseKey string
DatabaseDirectory string
Host string
Proxy string
ProxyUserPassword string
LockFile string
RetryFor string
EditionIDs []string
AccountID int
PreserveFileTimes int
Parallelism int
}
GeoIPConfig represents a parsed GeoIP.conf file.
func ParseGeoIPConfig ¶
func ParseGeoIPConfig(path string) (*GeoIPConfig, error)
ParseGeoIPConfig parses a GeoIP.conf file.