config

package
v0.7.26 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilePath

func FilePath() string

func IsLocalFile

func IsLocalFile(path string) bool

func Parse

func Parse() error

Parse 解析配置文件,支持本地文件系统和网络链接

func ReadFile

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

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

func ResourceRoot

func ResourceRoot() string

返回資源文件所在的根目錄.

func SetFilePath

func SetFilePath(path string)

Types

type ConfigOptions

type ConfigOptions struct {
	Domain                string     `json:"domain" yaml:"domain"`
	Port                  string     `json:"port" yaml:"port"`
	DatabaseUrl           string     `json:"database_url" yaml:"database_url"`
	CrawlInterval         uint64     `json:"crawl-interval" yaml:"crawl-interval"`
	CFEmail               string     `json:"cf_email" yaml:"cf_email"`
	CFKey                 string     `json:"cf_key" yaml:"cf_key"`
	SourceFiles           []string   `json:"source-files" yaml:"source-files"`
	HealthCheckTimeout    int        `json:"healthcheck-timeout" yaml:"healthcheck-timeout"`
	HealthCheckConnection int        `json:"healthcheck-connection" yaml:"healthcheck-connection"`
	SpeedTest             bool       `json:"speedtest" yaml:"speedtest"`
	SpeedTestInterval     uint64     `json:"speedtest-interval" yaml:"speedtest-interval"`
	SpeedTimeout          int        `json:"speed-timeout" yaml:"speed-timeout"`
	SpeedConnection       int        `json:"speed-connection" yaml:"speed-connection"`
	ActiveFrequency       uint16     `json:"active-frequency" yaml:"active-frequency" `
	ActiveInterval        uint64     `json:"active-interval" yaml:"active-interval"`
	ActiveMaxNumber       uint16     `json:"active-max-number" yaml:"active-max-number"`
	NetflixTest           bool       `json:"netflix-test" yaml:"netflix-test"`
	DisneyTest            bool       `json:"disney-test" yaml:"disney-test"`
	StreamMaxConn         int        `json:"stream-max-connect" yaml:"stream-max-connect"`
	PoolFiles             []PoolFile `json:"pool-files" yaml:"pool-files"`
	PoolFilesCheck        bool       `json:"pool-files-check" yaml:"pool-files-check"`
}
var Config ConfigOptions

Config 配置

func (ConfigOptions) HostUrl

func (config ConfigOptions) HostUrl() string

type PoolFile added in v0.7.15

type PoolFile struct {
	Type string `json:"type" yaml:"type"`
	Url  string `json:"url" yaml:"url"`
}

type Source

type Source struct {
	Type    string       `json:"type" yaml:"type"`
	Options tool.Options `json:"options" yaml:"options"`
}

Jump to

Keyboard shortcuts

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