cnf

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeclarePflags

func DeclarePflags()

DeclarePflags declares cnf pflags.

func DeclarePflagsByStruct

func DeclarePflagsByStruct(structVar interface{})

DeclarePflagsByStruct declares flags from struct fields'name and type

func FindFile

func FindFile(cnfFile string) (string, error)

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 LoadE

func LoadE(cnfFile string, value interface{}) error

LoadE similar to Load.

func ParsePflags

func ParsePflags(envPrefix string) error

ParsePflags parse pflags and bind to viper

func ViperToStruct

func ViperToStruct(structVar interface{})

ViperToStruct read viper value to struct

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL