Documentation
¶
Index ¶
- func CheckUnknownPFlags()
- func DeclarePflags()
- func DeclarePflagsByStruct(structVars ...interface{})
- func FindFile(cnfFile string) (string, error)
- func GetSeparator(v interface{}, defaultSeparator string) string
- func Load(cnfFile string, values ...interface{})
- func LoadByPflag(cfgValues ...interface{})
- func LoadE(cnfFile string, values ...interface{}) error
- func ParsePflags(envPrefix string) error
- func ViperToStruct(structVars ...interface{})
- type Separator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckUnknownPFlags ¶
func CheckUnknownPFlags()
CheckUnknownPFlags checks the pflag and exiting.
func DeclarePflagsByStruct ¶
func DeclarePflagsByStruct(structVars ...interface{})
DeclarePflagsByStruct declares flags from struct fields'name and type
func FindFile ¶
FindFile tries to find cnfFile from specified path, or current path cnf.toml, executable path cnf.toml.
func GetSeparator ¶
GetSeparator get separator from 1. viper's separator 2. v which implements Separator interface 3. or default value
func Load ¶
func Load(cnfFile string, values ...interface{})
Load loads the cnfFile content and viper bindings to value.
func LoadByPflag ¶
func LoadByPflag(cfgValues ...interface{})
LoadByPflag load values to cfgValue from pflag cnf specified path.
func ParsePflags ¶
ParsePflags parse pflags and bind to viper
func ViperToStruct ¶
func ViperToStruct(structVars ...interface{})
ViperToStruct read viper value to struct
Types ¶
Click to show internal directories.
Click to hide internal directories.