Documentation
¶
Overview ¶
Package config
基于configen的配置文件加载实现 默认的配置文件为继承自json的*.pig文件
Index ¶
Constants ¶
View Source
const ( GlobalConfigRoot = "conf" GlobalConfigFile = "apollo.pig" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CI ¶
type CI struct {
DockerHost string `json:"docker_host"`
DockerTimeout int `json:"docker_timeout"`
DockerAPIVersion string `json:"docker_api_version"`
}
CI CI配置
type DConfig ¶
type DConfig struct {
ServiceRoot string `json:"service_root"` // 服务架构的根目录
APPRoot string `json:"app_root"` // 整个服务的根目录
APPManager string `json:"app_manager"` // 管理服务所在目录
APPCacheDir string `json:"app_cache_dir"` // 服务缓存目录
APPLogDir string `json:"app_log_dir"` // 服务日志目录
APPTmpDir string `json:"app_tmp_dir"` // 服务临时文件目录
APPBackUp string `json:"app_back_up"` // 服务备份目录
APPPidDir string `json:"app_pid_dir"` // 服务运行时的pid
// logger
Log DLog `json:"log"`
// DB
DB DDb `json:"db"`
// Server
Server Server `json:"server"`
// CI
CI CI `json:"ci"`
// contains filtered or unexported fields
}
DConfig 全局配置
var ApolloConf DConfig
type DDb ¶
type DDb struct {
Sqlite Sqlite `json:"sqlite"`
Mongo Mongo `json:"mongo"`
Redis Redis `json:"redis"`
}
DDb Database Config
type DLog ¶
type DLog struct {
EnableLog string `json:"enable_log"` // yes | no
EnableStack string `json:"enable_stack"` // default disabled
EnableFunction string `json:"enable_function"` // default disabled
EnableCaller string `json:"enable_caller"` // default enabled
LogFile string `json:"log_file"` // default stderr
Encoding string `json:"encoding"` // default encoding json/console
}
DLog log config
Click to show internal directories.
Click to hide internal directories.