Documentation
¶
Index ¶
- Constants
- Variables
- func DebugPrintf(format string, v ...interface{})
- func ErrorPrintf(format string, v ...interface{})
- func Fatalf(format string, v ...interface{})
- func InfoPrintf(format string, v ...interface{})
- func WarnPrintf(format string, v ...interface{})
- type Config
- type MMDBConfig
- type Mirror
- type MirrorStatus
- type MonitorConfig
Constants ¶
View Source
const ( MMDB_DBIP = iota MMDB_MAXMIND )
View Source
const AppName = "mirrorselect"
Variables ¶
View Source
var Commit = "$Format:%h$"
View Source
var Date = "$Format:%cs$"
View Source
var Version = "$Format:%(describe:tags=true,abbrev=0)$"
Use 'var' instead of 'const' since we may override them via -ldflags.
Functions ¶
func DebugPrintf ¶
func DebugPrintf(format string, v ...interface{})
func ErrorPrintf ¶
func ErrorPrintf(format string, v ...interface{})
func InfoPrintf ¶
func InfoPrintf(format string, v ...interface{})
func WarnPrintf ¶
func WarnPrintf(format string, v ...interface{})
Types ¶
type Config ¶
type Config struct {
Debug bool `mapstructure:"debug"`
Listen string `mapstructure:"listen"`
MirrorListFile string `mapstructure:"mirror_list"`
Mirrors map[string]*Mirror
MMDBType string `mapstructure:"mmdb_type"`
MMDBFile string `mapstructure:"mmdb_file"`
MMDB MMDBConfig
Monitor MonitorConfig
}
var AppConfig *Config
type MMDBConfig ¶
type MMDBConfig struct {
Type int
DB *maxminddb.Reader
}
type Mirror ¶
type Mirror struct {
Name string `mapstructure:"name" json:"name"`
IsDefault bool `mapstructure:"default" json:"default"`
URL string `mapstructure:"url" json:"url"`
ContinentCode string `mapstructure:"continent_code" json:"continent_code"`
CountryCode string `mapstructure:"country_code" json:"country_code"`
Latitude float64 `mapstructure:"latitude" json:"latitude"`
Longitude float64 `mapstructure:"longitude" json:"longitude"`
Status MirrorStatus `json:"status"`
}
type MirrorStatus ¶
type MonitorConfig ¶
type MonitorConfig struct {
Workers int `mapstructure:"workers"`
Interval time.Duration `mapstructure:"interval"`
Timeout time.Duration `mapstructure:"timeout"`
Hysteresis int `mapstructure:"hysteresis"`
TLSVerify bool `mapstructure:"tls_verify"`
UserAgent string `mapstructure:"user_agent"`
NotifyExec string `mapstructure:"notify_exec"`
ExecTimeout time.Duration `mapstructure:"exec_timeout"`
}
Click to show internal directories.
Click to hide internal directories.