viper

package
v0.0.0-...-315b7b0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithLogger

func WithLogger(logger *logrus.Logger) interfaces.ConfigurationOption

func WithName

func WithName(name string) interfaces.ConfigurationOption

func WithProvider

func WithProvider(provider string) interfaces.ConfigurationOption

Types

type Viper

type Viper struct {
	*viper.Viper
	*logrus.Logger
	// contains filtered or unexported fields
}

func New

func New(options ...interfaces.ConfigurationOption) (*Viper, error)

func (*Viper) Get

func (v *Viper) Get(key string) (interface{}, error)

func (*Viper) GetArrayOfStringsOrDefault

func (v *Viper) GetArrayOfStringsOrDefault(path string, defaultValue []string) []string

func (*Viper) GetBoolOrDefault

func (v *Viper) GetBoolOrDefault(path string, defaultValue bool) bool

func (*Viper) GetDurationOrDefault

func (v *Viper) GetDurationOrDefault(path string, defaultValue time.Duration) time.Duration

func (*Viper) GetFloat64OrDefault

func (v *Viper) GetFloat64OrDefault(path string, defaultValue float64) float64

func (*Viper) GetIntOrDefault

func (v *Viper) GetIntOrDefault(path string, defaultValue int) int

func (*Viper) GetMapOfStringOrDefault

func (v *Viper) GetMapOfStringOrDefault(path string, defaultValue map[string]string) map[string]string

func (*Viper) GetStringOrDefault

func (v *Viper) GetStringOrDefault(path string, defaultValue string) string

func (*Viper) Open

func (v *Viper) Open(paths ...string) error

func (*Viper) Save

func (v *Viper) Save(data interface{}) error

func (*Viper) Set

func (v *Viper) Set(key string, value interface{}) error

Jump to

Keyboard shortcuts

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