conf

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllSettings

func AllSettings() map[string]interface{}

AllSettings merges all settings and returns them as a map[string]interface{}.

func Get

func Get(key string) interface{}

Get can retrieve any value given the key to use.

func GetBool

func GetBool(key string) bool

GetBool returns the value associated with the key as a boolean.

func GetFloat64

func GetFloat64(key string) float64

GetFloat64 returns the value associated with the key as a float64.

func GetInt

func GetInt(key string) int

GetInt returns the value associated with the key as an integer.

func GetInt64

func GetInt64(key string) int64

GetInt64 returns the value associated with the key as an integer.

func GetIntSlice

func GetIntSlice(key string) []int

GetIntSlice returns the value associated with the key as a slice of int values.

func GetString

func GetString(key string) string

GetString returns the value associated with the key as a string.

func GetStringMapString

func GetStringMapString(key string) map[string]string

GetStringMapString returns the value associated with the key as a map of strings.

func GetStringMapStringSlice

func GetStringMapStringSlice(key string) map[string][]string

GetStringMapStringSlice returns the value associated with the key as a map to a slice of strings.

func GetStringSlice

func GetStringSlice(key string) []string

GetStringSlice returns the value associated with the key as a slice of strings.

func GetStringWithDefault

func GetStringWithDefault(key, d string) string

GetStringWithDefault returns the value associated with the key as a string, if key not exist, return default value.

func GetTime

func GetTime(key string) time.Time

GetTime returns the value associated with the key as time.

func GetUint64

func GetUint64(key string) uint64

GetUint64 returns the value associated with the key as an unsigned integer.

func GetWithDefault

func GetWithDefault(key string, d interface{}) interface{}

GetWithDefault returns the value associated with the key, if key not exist, return default value.

func IsSet

func IsSet(key string) bool

IsSet checks to see if the key has been set in any of the data locations.

func OnConfigChange

func OnConfigChange(run func(in fsnotify.Event))

OnConfigChange will call the input func when configuration changes

func Set

func Set(key string, value interface{})

Set sets the value for the key in the override register. Set is case-insensitive for a key. Will be used instead of values obtained via flags, config file, ENV, default, or key/value store.

func SetDefault

func SetDefault(key string, value interface{})

SetDefault sets the default value for this key. SetDefault is case-insensitive for a key.

func UnmarshalKey

func UnmarshalKey(key string, rawVal interface{}) error

UnmarshalKey takes a single key and marshals it into a Struct

func WatchConfig

func WatchConfig()

WatchConfig tells viper to watch configuration changes

func WriteConfigAs

func WriteConfigAs(filename string) error

WriteConfigAs writes current configuration to a given filename.

Types

This section is empty.

Jump to

Keyboard shortcuts

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