config

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: May 11, 2024 License: MIT Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

func BindPFlags(flags *pflag.FlagSet) error

BindPFlags binds a full flag set to the configuration, using each flag's long name as the config key.

func Get

func Get(path ...string) interface{}

Get a value from the config

func GetBool added in v1.5.3

func GetBool(path ...string) bool

GetBool a boolean value from the config

func GetDuration added in v1.4.20

func GetDuration(path ...string) time.Duration

GetDuration a duration value from the config

func GetFloat added in v1.4.20

func GetFloat(path ...string) float64

GetFloat a float value from the config

func GetInt added in v1.4.20

func GetInt(path ...string) int

GetInt a int64 value from the config

func GetInt32 added in v1.4.20

func GetInt32(path ...string) int32

GetInt32 a int32 value from the config

func GetInt64 added in v1.4.20

func GetInt64(path ...string) int64

GetInt64 a int64 value from the config

func GetIntSlice added in v1.4.20

func GetIntSlice(path ...string) []int

GetIntSlice a int slice value from the config

func GetString added in v1.4.20

func GetString(path ...string) string

GetString a string value from the config

func GetStringMap added in v1.4.20

func GetStringMap(path ...string) map[string]interface{}

GetStringMap a string map value from the config

func GetStringSlice added in v1.4.20

func GetStringSlice(path ...string) []string

GetStringSlice a string slice value from the config

func ReadConfig added in v1.4.20

func ReadConfig(in io.Reader) error

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 Set

func Set(value interface{}, path ...string)

Set a value in the config

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 Sync added in v1.4.20

func Sync() error

Sync apply value to .vine config

func SyncAs added in v1.4.20

func SyncAs(filename string) error

SyncAs writes current configuration to a given filename.

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

func UnmarshalKey(rawVal interface{}, path ...string) error

UnmarshalKey takes a single key and unmarshals it into a Struct.

Types

This section is empty.

Jump to

Keyboard shortcuts

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