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
Click to show internal directories.
Click to hide internal directories.