config

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(path string) error

Parse Config file

func ReadFile

func ReadFile(path string) ([]byte, error)

从本地文件或者http链接读取配置文件内容

Types

type ConfigOptions

type ConfigOptions struct {
	ServerUrl             []string `json:"server_url" yaml:"server_url"`
	Domain                string   `json:"domain" yaml:"domain"`
	Port                  string   `json:"port" yaml:"port"`
	Request               string   `json:"request" yaml:"request"`
	CronInterval          uint64   `json:"cron_interval" yaml:"cron_interval"`
	ShowRemoteSpeed       bool     `json:"show_remote_speed" yaml:"show_remote_speed"`
	HealthCheckTimeout    int      `json:"healthcheck_timeout" yaml:"healthcheck_timeout"`
	HealthCheckConnection int      `json:"healthcheck_connection" yaml:"healthcheck_connection"`
	SpeedTest             bool     `json:"speedtest" yaml:"speedtest"`
	SpeedConnection       int      `json:"speed_connection" yaml:"speed_connection"`
	SpeedTimeout          int      `json:"speed_timeout" yaml:"speed_timeout"`
}

ConfigOptions is a struct that represents config files

var Config ConfigOptions

Jump to

Keyboard shortcuts

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