config

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2022 License: GPL-3.0 Imports: 10 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultCustomOptions = &CustomOptions{
	Path: "./conf/conf.yaml",
}

Functions

func AddConfigPath

func AddConfigPath(in string)

func AddSecureRemoteProvider

func AddSecureRemoteProvider(provider, endpoint, path, secretkeyring string) error

func AllKeys

func AllKeys() []string

func AllSettings

func AllSettings() map[string]interface{}

func AllowEmptyEnv

func AllowEmptyEnv(allowEmptyEnv bool)

func AutomaticEnv

func AutomaticEnv()

func BindEnv

func BindEnv(input ...string) error

func BindFlagValue

func BindFlagValue(key string, flag viper.FlagValue) error

func BindFlagValues

func BindFlagValues(flags viper.FlagValueSet) error

func BindPFlag

func BindPFlag(key string, flag *pflag.Flag) error

func BindPFlags

func BindPFlags(flags *pflag.FlagSet) error

func Debug

func Debug()

func Get

func Get(key string) interface{}

func GetBool

func GetBool(key string) bool

func GetDuration

func GetDuration(key string) time.Duration

func GetFloat64

func GetFloat64(key string) float64

func GetInt

func GetInt(key string) int

func GetInt32

func GetInt32(key string) int32

func GetInt64

func GetInt64(key string) int64

func GetIntSlice

func GetIntSlice(key string) []int

func GetSizeInBytes

func GetSizeInBytes(key string) uint

func GetString

func GetString(key string) string

func GetStringMap

func GetStringMap(key string) map[string]interface{}

func GetStringMapString

func GetStringMapString(key string) map[string]string

func GetStringMapStringSlice

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

func GetStringSlice

func GetStringSlice(key string) []string

func GetTime

func GetTime(key string) time.Time

func GetUint

func GetUint(key string) uint

func GetUint32

func GetUint32(key string) uint32

func GetUint64

func GetUint64(key string) uint64

func GetViper

func GetViper() *viper.Viper

func InConfig

func InConfig(key string) bool

func IniLoadOptions

func IniLoadOptions(in ini.LoadOptions) viper.Option

func InitConfig

func InitConfig()

func IsSet

func IsSet(key string) bool

func MergeConfig

func MergeConfig(in io.Reader) error

func MergeConfigMap

func MergeConfigMap(cfg map[string]interface{}) error

func MergeInConfig

func MergeInConfig() error

func ReadConfig

func ReadConfig(in io.Reader) error

func ReadRemoteConfig

func ReadRemoteConfig() error

func RegisterAlias

func RegisterAlias(alias string, key string)

func SafeWriteConfig

func SafeWriteConfig() error

func SafeWriteConfigAs

func SafeWriteConfigAs(filename string) error

func Set

func Set(key string, value interface{})

func SetConfigName

func SetConfigName(in string)

func SetConfigPermissions

func SetConfigPermissions(perm os.FileMode)

func SetConfigType

func SetConfigType(in string)

func SetDefault

func SetDefault(key string, value interface{})

func SetEnvKeyReplacer

func SetEnvKeyReplacer(r *strings.Replacer)

func SetFs

func SetFs(fs afero.Fs)

func SetTypeByDefaultValue

func SetTypeByDefaultValue(enable bool)

func Sub

func Sub(key string) *viper.Viper

func Unmarshal

func Unmarshal(rawVal interface{}, opts ...viper.DecoderConfigOption) error

func UnmarshalExact

func UnmarshalExact(rawVal interface{}, opts ...viper.DecoderConfigOption) error

func UnmarshalKey

func UnmarshalKey(key string, rawVal interface{}, opts ...viper.DecoderConfigOption) error

func WatchConfig

func WatchConfig()

func WatchRemoteConfig

func WatchRemoteConfig() error

func WriteConfig

func WriteConfig() error

func WriteConfigAs

func WriteConfigAs(filename string) error

Types

type CustomOptions

type CustomOptions struct {
	Path string
}

Jump to

Keyboard shortcuts

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