Documentation ¶
Index ¶
- Constants
- Variables
- func ErrConfKeyType(key, dataType string) error
- func ErrConfMissingKey(key, dataType string) error
- func ErrMissConfigAliasMap() error
- func GetConfigDir(app string) (dir string, err error)
- func GetEnv(env string) string
- func GetEnvValue(envName string) (string, error)
- func GetStringList(value string) []string
- func Init(cflag, app, defaultConf string)
- func IsEnv(env string) (string, bool)
- func Load(conf interface{}) error
- func LoadEx(conf interface{}, confName string) error
- func LoadFile(conf interface{}, confName string) (err error)
- type AliasKey
- type MapConf
- func (conf MapConf) Get(key string) (interface{}, error)
- func (c MapConf) GetAliasList(key string) (aks []AliasKey, err error)
- func (conf MapConf) GetAliasMap(key string) (map[string]string, error)
- func (conf MapConf) GetAliasMapOr(key string, deft map[string]string) (map[string]string, error)
- func (conf MapConf) GetBool(key string) (bool, error)
- func (conf MapConf) GetBoolOr(key string, deft bool) (bool, error)
- func (conf MapConf) GetInt(key string) (int, error)
- func (conf MapConf) GetInt32(key string) (int32, error)
- func (conf MapConf) GetInt32Or(key string, deft int32) (int32, error)
- func (conf MapConf) GetInt64(key string) (int64, error)
- func (conf MapConf) GetInt64Or(key string, deft int64) (int64, error)
- func (conf MapConf) GetIntOr(key string, deft int) (int, error)
- func (conf MapConf) GetPasswordEnvString(key string) (string, error)
- func (conf MapConf) GetPasswordEnvStringOr(key, deft string) (string, error)
- func (conf MapConf) GetString(key string) (string, error)
- func (conf MapConf) GetStringList(key string) ([]string, error)
- func (conf MapConf) GetStringListOr(key string, deft []string) ([]string, error)
- func (conf MapConf) GetStringOr(key string, deft string) (string, error)
Constants ¶
View Source
const ( StringType = "string" IntType = "int" Int64Type = "int64" Int32Type = "int32" BoolType = "bool" StringListType = "[]string" AliasMapType = "[string string, string]" )
conf types
Variables ¶
View Source
var ( NL = []byte{'\n'} ANT = []byte{'#'} )
View Source
var ErrHomeNotFound = errors.New("$HOME not found")
Functions ¶
func ErrConfKeyType ¶
func ErrConfMissingKey ¶
func ErrMissConfigAliasMap ¶
func ErrMissConfigAliasMap() error
func GetConfigDir ¶
func GetEnvValue ¶ added in v1.5.4
func GetStringList ¶ added in v1.5.4
Types ¶
type MapConf ¶
MapConf 基于Map的配置信息
func (MapConf) GetAliasMapOr ¶
func (MapConf) GetInt32Or ¶ added in v1.5.3
func (MapConf) GetPasswordEnvString ¶ added in v1.5.4
func (MapConf) GetPasswordEnvStringOr ¶ added in v1.5.4
func (MapConf) GetStringListOr ¶
Click to show internal directories.
Click to hide internal directories.