configurator

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ConfigPathDefault path to directory of configuration file on default
	ConfigPathDefault = "."

	// ConfigNameDefault name configuration file on default
	ConfigNameDefault = "config"

	// ConfigTypeDefault format configuration file on default
	ConfigTypeDefault = "yaml"

	// EnvKeyReplaceFromDefault replace character when reading env variables with specified
	EnvKeyReplaceFromDefault = "."

	// EnvKeyReplaceToDefault replace the character when reading env variables with the specified one
	EnvKeyReplaceToDefault = "_"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Configurator

type Configurator interface {
	GetString(string) string
	GetBool(string) bool
	GetInt(string) int
	GetInt32(string) int32
	GetInt64(string) int64
	GetUint(string) uint
	GetUint32(string) uint32
	GetUint64(string) uint64
	GetFloat64(string) float64
	GetTime(string) time.Time
	GetDuration(string) time.Duration
	GetIntSlice(string) []int
	GetStringSlice(string) []string
	GetStringMap(string) map[string]interface{}
	GetStringMapString(string) map[string]string
	GetStringMapStringSlice(string) map[string][]string
	GetSizeInBytes(string) uint

	SetDefault(string, interface{})
}

Configurator general interface for configurator a application

func NewViper

func NewViper() (Configurator, error)

NewViper creating and configuration instance of viper.Viper implements Configurator

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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