Documentation ¶
Index ¶
- Variables
- func AddConfigPath(in string)
- func AddExclude(items ...string)
- func BindPFlags(flags *pflag.FlagSet) error
- func Get(path ...string) interface{}
- func GetBool(path ...string) bool
- func GetDuration(path ...string) time.Duration
- func GetFloat(path ...string) float64
- func GetInt(path ...string) int
- func GetInt32(path ...string) int32
- func GetInt64(path ...string) int64
- func GetIntSlice(path ...string) []int
- func GetString(path ...string) string
- func GetStringMap(path ...string) map[string]interface{}
- func GetStringSlice(path ...string) []string
- func ReadConfig(in io.Reader) error
- func ReadInConfig() error
- func Set(value interface{}, path ...string)
- func SetConfigFile(in string)
- func SetConfigName(in string)
- func SetConfigType(in string)
- func Sync() error
- func SyncAs(filename string) error
- func Unmarshal(rawVal interface{}) error
- func UnmarshalKey(rawVal interface{}, path ...string) error
Constants ¶
This section is empty.
Variables ¶
var FileName = "vine.yml"
FileName for global vine config, format yaml
Functions ¶
func AddConfigPath ¶ added in v1.4.21
func AddConfigPath(in string)
AddConfigPath adds a path to search for the config file in. Can be called multiple times to define multiple search paths.
func AddExclude ¶ added in v1.4.21
func AddExclude(items ...string)
func BindPFlags ¶ added in v1.4.20
BindPFlags binds a full flag set to the configuration, using each flag's long name as the config key.
func GetDuration ¶ added in v1.4.20
GetDuration a duration value from the config
func GetIntSlice ¶ added in v1.4.20
GetIntSlice a int slice value from the config
func GetStringMap ¶ added in v1.4.20
GetStringMap a string map value from the config
func GetStringSlice ¶ added in v1.4.20
GetStringSlice a string slice value from the config
func ReadConfig ¶ added in v1.4.20
ReadConfig reads a new configuration with an existing config.
func ReadInConfig ¶ added in v1.4.21
func ReadInConfig() error
ReadInConfig will discover and load the configuration file from disk and key/value stores, searching in one of the defined paths.
func SetConfigFile ¶ added in v1.4.21
func SetConfigFile(in string)
SetConfigFile explicitly defines the path, name and extension of the config file.
func SetConfigName ¶ added in v1.4.21
func SetConfigName(in string)
SetConfigName sets name for the config file. Does not include extension.
func SetConfigType ¶ added in v1.4.20
func SetConfigType(in string)
SetConfigType sets the type of the configuration returned by the remote source, e.g. "json".
func Unmarshal ¶ added in v1.4.20
func Unmarshal(rawVal interface{}) error
Unmarshal unmarshals the config into a Struct. Make sure that the tags on the fields of the structure are properly set.
func UnmarshalKey ¶ added in v1.4.20
UnmarshalKey takes a single key and unmarshals it into a Struct.
Types ¶
This section is empty.