Documentation ¶
Index ¶
- Constants
- func GetAccountDBPath(configType ConfigType) string
- func GetAccountFilePath(configType ConfigType) string
- func GetApiHosts(configType ConfigType) []string
- func GetCredentials(configType ConfigType) auth.Credentials
- func GetIoHosts(configType ConfigType) []string
- func GetRsHosts(configType ConfigType) []string
- func GetRsfHosts(configType ConfigType) []string
- func GetUcHosts(configType ConfigType) []string
- func GetUpHosts(configType ConfigType) []string
- func LoadGlobalConfig(globalConfigPath string) *data.CodeError
- func LoadUserConfig(userConfigPath string) *data.CodeError
- type Config
- type ConfigType
- type Hosts
- type LoadInfo
- type LogSetting
- type Retry
- type Tasks
Constants ¶
View Source
const ( NoneKey = "none" DebugKey = "debug" InfoKey = "info" WarnKey = "warn" ErrorKey = "error" )
Variables ¶
This section is empty.
Functions ¶
func GetAccountDBPath ¶
func GetAccountDBPath(configType ConfigType) string
func GetAccountFilePath ¶
func GetAccountFilePath(configType ConfigType) string
func GetApiHosts ¶
func GetApiHosts(configType ConfigType) []string
func GetCredentials ¶
func GetCredentials(configType ConfigType) auth.Credentials
func GetIoHosts ¶
func GetIoHosts(configType ConfigType) []string
func GetRsHosts ¶
func GetRsHosts(configType ConfigType) []string
func GetRsfHosts ¶
func GetRsfHosts(configType ConfigType) []string
func GetUcHosts ¶
func GetUcHosts(configType ConfigType) []string
func GetUpHosts ¶
func GetUpHosts(configType ConfigType) []string
func LoadGlobalConfig ¶ added in v2.9.2
func LoadUserConfig ¶ added in v2.9.2
Types ¶
type Config ¶
type Config struct { CmdId string `json:"-"` // 命令 Id Credentials *auth.Credentials `json:"-"` UseHttps *data.Bool `json:"use_https,omitempty"` Hosts *Hosts `json:"hosts,omitempty"` Log *LogSetting `json:"log"` }
func (*Config) HasCredentials ¶
func (*Config) IsUseHttps ¶
type ConfigType ¶
type ConfigType int8
const ( ConfigTypeDefault ConfigType = 1 ConfigTypeUser ConfigType = 2 ConfigTypeGlobal ConfigType = 3 )
type Hosts ¶
type LogSetting ¶
type LogSetting struct { LogLevel *data.String `json:"log_level,omitempty"` LogFile *data.String `json:"log_file,omitempty"` LogRotate *data.Int `json:"log_rotate,omitempty"` LogStdout *data.Bool `json:"log_stdout,omitempty"` }
func (*LogSetting) Check ¶
func (l *LogSetting) Check() *data.CodeError
func (*LogSetting) Enable ¶
func (l *LogSetting) Enable() bool
func (*LogSetting) GetLogLevel ¶
func (l *LogSetting) GetLogLevel() (logLevel int)
func (*LogSetting) IsLogStdout ¶
func (l *LogSetting) IsLogStdout() bool
Click to show internal directories.
Click to hide internal directories.