package
1.0.4
Repository: https://github.com/tal-tech/xtools.git
Documentation: pkg.go.dev

# Functions

the default conf directory,generated by home().
cache force clearNOTICE:clear the cache only you change the config source.
get config value with object value return.
get config functionsection: first keykey:second key.
get config mapreturn map[string][]string,like: [Redis] reids = 127.0.0.1:6379 127.0.0.0:7379 */GetConfArrayMap("Redis") return map[string][]string{"redis":[127.0.0.1:6379,127.0.0.1:7379]}.
get config with defaultif value not existed,return default value def.
get configs function,like: [Redis] redis = 127.0.0.1:6379 127.0.0.1:7379 */GetConfs("Redis") like "redis = 127.0.0.1:6379 127.0.0.1:7379",return []string{127.0.0.1:6379,127.0.0.1:7379}.
get configmapreturn map[string]string.
config init functioninclude 3 load module(ini,yaml,any),any is a plugin module,support second develop.
file load functioninclude 3 load module(ini,yaml,any),any module support pluginsby use flag -c=xxx,and you need provide a xxx.go which implement theConfig interface and register the load function in plugin.go.
config set function.
path prefix,if the path is not absolute path,you canset the prefix manual.

# Variables

config path prefix if your config path is not a absolute path.

# Structs

any structexample for config pluginno config source type limitedonly need to write the load function to init the data.
ini structimplement the Config interface.
yaml structsupport yaml file parseimplemented Config interface.

# Interfaces

Config interface definitiondevelopers can implement this interface to combine with other config library.