config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config interface {
	Get(key string) interface{}

	GetString(key string) string

	GetBool(key string) bool

	GetInt(key string) int

	GetInt32(key string) int32

	GetInt64(key string) int64

	GetUint(key string) uint

	GetUint32(key string) uint32

	GetUint64(key string) uint64

	GetFloat64(key string) float64

	GetTime(key string) time.Time

	GetDuration(key string) time.Duration

	GetStringSlice(key string) []string

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

	GetStringMapString(key string) map[string]string

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

	GetSizeInBytes(key string) uint

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

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

	Set(key string, value interface{})
}

func NewViperConfig

func NewViperConfig(options ...Option) Config

type MemConfig

type MemConfig struct {
	// contains filtered or unexported fields
}

func NewMemConfig

func NewMemConfig() *MemConfig

func (*MemConfig) Get

func (mc *MemConfig) Get(key string) interface{}

func (*MemConfig) GetBool

func (mc *MemConfig) GetBool(key string) bool

func (*MemConfig) GetDuration

func (mc *MemConfig) GetDuration(key string) time.Duration

func (*MemConfig) GetFloat64

func (mc *MemConfig) GetFloat64(key string) float64

func (*MemConfig) GetInt

func (mc *MemConfig) GetInt(key string) int

func (*MemConfig) GetInt32

func (mc *MemConfig) GetInt32(key string) int32

func (*MemConfig) GetInt64

func (mc *MemConfig) GetInt64(key string) int64

func (*MemConfig) GetSizeInBytes

func (mc *MemConfig) GetSizeInBytes(key string) uint

Not implemented.

func (*MemConfig) GetString

func (mc *MemConfig) GetString(key string) string

func (*MemConfig) GetStringMap

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

func (*MemConfig) GetStringMapString

func (mc *MemConfig) GetStringMapString(key string) map[string]string

func (*MemConfig) GetStringMapStringSlice

func (mc *MemConfig) GetStringMapStringSlice(key string) map[string][]string

func (*MemConfig) GetStringSlice

func (mc *MemConfig) GetStringSlice(key string) []string

func (*MemConfig) GetTime

func (mc *MemConfig) GetTime(key string) time.Time

func (*MemConfig) GetUint

func (mc *MemConfig) GetUint(key string) uint

func (*MemConfig) GetUint32

func (mc *MemConfig) GetUint32(key string) uint32

func (*MemConfig) GetUint64

func (mc *MemConfig) GetUint64(key string) uint64

func (*MemConfig) Set

func (mc *MemConfig) Set(key string, value interface{})

func (*MemConfig) Unmarshal

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

func (*MemConfig) UnmarshalKey

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

type NullConfig

type NullConfig struct{}

func NewNullConfig

func NewNullConfig() *NullConfig

func (*NullConfig) Get

func (nc *NullConfig) Get(key string) interface{}

func (*NullConfig) GetBool

func (nc *NullConfig) GetBool(key string) bool

func (*NullConfig) GetDuration

func (nc *NullConfig) GetDuration(key string) time.Duration

func (*NullConfig) GetFloat64

func (nc *NullConfig) GetFloat64(key string) float64

func (*NullConfig) GetInt

func (nc *NullConfig) GetInt(key string) int

func (*NullConfig) GetInt32

func (nc *NullConfig) GetInt32(key string) int32

func (*NullConfig) GetInt64

func (nc *NullConfig) GetInt64(key string) int64

func (*NullConfig) GetSizeInBytes

func (nc *NullConfig) GetSizeInBytes(key string) uint

Not implemented.

func (*NullConfig) GetString

func (nc *NullConfig) GetString(key string) string

func (*NullConfig) GetStringMap

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

func (*NullConfig) GetStringMapString

func (nc *NullConfig) GetStringMapString(key string) map[string]string

func (*NullConfig) GetStringMapStringSlice

func (nc *NullConfig) GetStringMapStringSlice(key string) map[string][]string

func (*NullConfig) GetStringSlice

func (nc *NullConfig) GetStringSlice(key string) []string

func (*NullConfig) GetTime

func (nc *NullConfig) GetTime(key string) time.Time

func (*NullConfig) GetUint

func (nc *NullConfig) GetUint(key string) uint

func (*NullConfig) GetUint32

func (nc *NullConfig) GetUint32(key string) uint32

func (*NullConfig) GetUint64

func (nc *NullConfig) GetUint64(key string) uint64

func (*NullConfig) Set

func (nc *NullConfig) Set(key string, value interface{})

func (*NullConfig) Unmarshal

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

func (*NullConfig) UnmarshalKey

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

type Option

type Option func(c *viperConf)

type ViperConfOptions

type ViperConfOptions struct{}

func (ViperConfOptions) WithConfFile

func (ViperConfOptions) WithConfFile(configFile []string) Option

func (ViperConfOptions) WithConfigType

func (ViperConfOptions) WithConfigType(configType string) Option

Jump to

Keyboard shortcuts

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