config

package
v1.3.9 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2024 License: Apache-2.0 Imports: 14 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{}
	GetBool(key string) bool
	GetInt(key string) int
	GetFloat(key string) float64
	GetString(key string) string
	GetTime(key string) time.Time
	GetDuration(key string) time.Duration
	GetViper() *viper.Viper
	Has(key string) bool
	Sub(key string) Config
	AddObserver(o Observer)
	AddObserverFunc(f func(Config, chan error))
	Dump() string
	Exist() bool
}

func NewFilesContainer

func NewFilesContainer(log log.Logger, rootFolder util.Dirs, configFiles ...string) Config

NewFilesContainer Initialise configuration container to read files from the FS

func NewReaderContainer

func NewReaderContainer(log log.Logger, format string, configReaders ...io.Reader) Config

NewReaderContainer Initialise configuration container to read config from ioReader

type Observer

type Observer struct {
	Run func(Config, chan error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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