config

package
v0.0.0-...-4972dd0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2020 License: BSD-3-Clause Imports: 22 Imported by: 0

Documentation

Overview

此文件包含安全信息,编译时请根据实际部署修改其中的内容, 并将文件拷贝为settings.pack.toml.go

客户端运行所需的相关配置ke

Index

Constants

View Source
const (
	MAX_CONNECTIONS = 15000
	// 客户端响应超时
	CLIENT_TIMEOUT  = time.Second * 5
	CLIENT_MAX_IDLE = time.Second * 120
	// 请求处理超时
	PROCESS_TIMEOUT = int64(10)
)

Variables

This section is empty.

Functions

func DebugEnabled

func DebugEnabled() bool

TODO: not coroutine safe

func DecodeSetting

func DecodeSetting() []byte

解码编码后的配置

func GetBiPidFile

func GetBiPidFile() string

func GetLocalIp

func GetLocalIp() string

func GetLocalStorageDir

func GetLocalStorageDir() string

func GetZkConfig

func GetZkConfig() map[string]interface{}

func LookupOsUidGid

func LookupOsUidGid(name string) (uid int, gid int, err error)

func ParsePostUpdateRule

func ParsePostUpdateRule(ruleFile string) ([][]string, error)

POST_UPDATE_SCRIPTS_RULE

func ParseSecretSettings

func ParseSecretSettings() (*toml.TomlTree, error)

func Rchmod

func Rchmod(dir string, mode os.FileMode) error

RChmod 递归地修改指定目录及其文件的mode

func Rchown

func Rchown(dir string, uid int, gid int) error

RChown 递归地修改指定目录及其文件的所有者

func SetConfig

func SetConfig(name string, val interface{})

TODO: not coroutine safe

func SetConfigFile

func SetConfigFile(f string)

func SetDebug

func SetDebug(enable bool)

TODO: not coroutine safe

func Setup

func Setup() error

Types

type Config

type Config struct {
	ListenAddr       string
	ListenAddrTransi string
	RunAsBi          bool
	InstallDir       string
	PidFile          string

	DATA_ROOT             string
	DATA_DIR              string
	LOG_DIR               string
	CONFIG_DIR            []string
	DAEMON_USER           string
	DAEMON_UID            int
	DAEMON_GID            int
	POST_UPDATE_CALLBACKS []string
	POST_UPDATE_SCRIPTS   []string
	ENV                   string
	ClientVer             string
	ENCRYPT_ENABLE        bool
	ENCRYPT_KEY           string
	ENCRYPT_IV            string
	ENCRYPT_VER           float64
	DEVMODE               bool
	DEBUG_FILE            string

	ETCD_CONNECTION_TIMEOUT      int64
	ETCD_DIAL_KEEP_ALIVE_TIME    int64
	ETCD_DIAL_KEEP_ALIVE_TIMEOUT int64

	ETCD_HEARTBEAT_KEY        string
	ETCD_REQUEST_TIMEOUT      int64
	ETCD_MIN_RETRY_INTERVAL   int64
	ETCD_RETRY_INTERVAL_RANGE int64
	ETCD_AUTO_SYNC_INTERVAL   int64

	POST_UPDATE_SCRIPTS_RULE string
	PostUpdateRule           [][]string

	// 性能分析的侦听设置(未设置则不侦听).
	PPROF_LISTEN string
	// 当一个环境没有编译在dc中时,需要从远程服务器获取其信息.
	DOVE_SERVER string
}

func GetConfig

func GetConfig() Config

func ParseExtraConfig

func ParseExtraConfig() (*Config, error)

解析配置文件/etc/DoveClient.conf

type EnvInfo

type EnvInfo struct {
	Hosts string
	Key   string
	Iv    string
}

远程服务器返回的环境信息.

Jump to

Keyboard shortcuts

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