config

package
v2.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadProxies

func LoadProxies(filename string) []*url.URL

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"`
	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 ReadConfig

func ReadConfig(configFile string) (Config, error)

ReadConfig reads the config file and returns a filled Config struct.

Jump to

Keyboard shortcuts

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