Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadProxies ¶
LoadProxies tries to load the list of proxies from the given file. If it fails, it returns an empty list.
Types ¶
type Config ¶
type Config struct {
BotToken string `yaml:"bot_token"`
LangDirectory string `yaml:"lang_path"`
UpdateIntervalMinutes int `yaml:"update_interval_minutes"`
HTTPMaxTries int `yaml:"http_max_tries"`
MaxPriceAgents int64 `yaml:"max_price_agents"`
Webhook struct {
Enabled bool `yaml:"enabled"`
ListenIP string `yaml:"listen_ip"`
ListenPort int `yaml:"listen_port"`
ListenPath string `yaml:"listen_path"`
URL string `yaml:"url"`
CertPath string `yaml:"cert_path"`
CertKeyPath string `yaml:"cert_key_path"`
} `yaml:"webhook"`
Proxy struct {
Enabled bool `yaml:"enabled"`
ProxyListPath string `yaml:"proxy_list_path"`
} `yaml:"proxy"`
LogDirectory string `yaml:"log_directory"`
Prometheus struct {
Enabled bool `yaml:"enabled"`
ExportIP string `yaml:"export_ip"`
ExportPort int `yaml:"export_port"`
} `yaml:"prometheus"`
}
func GetConfig ¶ added in v2.2.0
GetConfig returns the config struct. If the config has not been initialized yet, an error is returned.
func ReadConfig ¶
ReadConfig reads the config file and returns a filled Config struct.
Click to show internal directories.
Click to hide internal directories.