Documentation ¶
Index ¶
- func DeclarePflags()
- func DeclarePflagsByStruct(structVar interface{})
- func FindFile(cnfFile string) (string, error)
- func Load(cnfFile string, value interface{})
- func LoadByPflag(cfgValue interface{})
- func LoadE(cnfFile string, value interface{}) error
- func ParsePflags(envPrefix string) error
- func ViperToStruct(structVar interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeclarePflagsByStruct ¶
func DeclarePflagsByStruct(structVar 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 Load ¶
func Load(cnfFile string, value interface{})
Load loads the cnfFile content and viper bindings to value.
func LoadByPflag ¶
func LoadByPflag(cfgValue interface{})
LoadByPflag load values to cfgValue from pflag cnf specified path.
func ParsePflags ¶
ParsePflags parse pflags and bind to viper
func ViperToStruct ¶
func ViperToStruct(structVar interface{})
ViperToStruct read viper value to struct
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.