config

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DirectMode = "Direct"
	ClientMode = "Client"
	ServerMode = "Server"
)

Variables

View Source
var (
	App     *Config
	RunMode string
	Token   string
)

Functions

func Load

func Load(filepath string) error

Types

type Config

type Config struct {
	RunMode   string           `yaml:""` // 模式
	Inbound   *constant.Server `yaml:""` // 服务端及客户端监听的本地端口
	Outbound  *constant.Server `yaml:""` // 远端服务器地址
	Dashboard *constant.Server `yaml:""` // Dashboard
	DNS       DNS              `yaml:""` // DNS配置
	Log       Log              `yaml:""` // 日志输出
}

type DNS

type DNS struct {
	NameServers []string          `yaml:""`
	Hosts       map[string]string `yaml:""`
}

type Log

type Log struct {
	Filename   string `yaml:""`
	Level      string `yaml:",default=info"`
	MaxBackups int    `yaml:",default=7"`
	MaxSize    int    `yaml:",default=500"`
	MaxAge     int    `yaml:",default=28"`
	Compress   bool   `yaml:",default=true"`
}

Jump to

Keyboard shortcuts

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