Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Version = "1.0.0"
Version is the configoro version.
Functions ¶
func DefaultEnvViper ¶
defaultViper make new instance of viper with config to read from .env file. file is absolute string path of file. e.g `configoro.SourcePath()+"../.env"`
func SourcePath ¶
func SourcePath() string
SourcePath returns the directory containing the source code that is calling this function.
Types ¶
type AfterLoadHook ¶
type AfterLoadHook interface {
AfterLoad() error
}
AfterLoadHook calls after loading config.
type BeforeLoadHook ¶
type BeforeLoadHook interface {
BeforeLoad() error
}
BeforeLoadHook calls before loading config.
type Config ¶
type Config interface { // Load function load config into config instance. pass instance by reference. Load(configInstance interface{}) error // Env function return environment value. Env(key string) string // Env function return environment value with default value. EnvDefault(key, def string) string }
Config is config interface that should embed in each Config object.
Click to show internal directories.
Click to hide internal directories.