Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
Environment string
ENVPrefix string
Debug bool
Verbose bool
Silent bool
AutoReload bool
AutoReloadInterval time.Duration
AutoReloadCallback func(config any)
// In case of json files, this field will be used only when compiled with
// go 1.10 or later.
// This field will be ignored when compiled with go versions lower than 1.10.
ErrorOnUnmatchedKeys bool
// You can use embed.FS or any other fs.FS to load configs from. Default - use "os" package
FS fs.FS
}
type Configor ¶
type Configor struct {
*Config
// contains filtered or unexported fields
}
func (*Configor) GetEnvironment ¶
GetEnvironment get environment
func (*Configor) GetErrorOnUnmatchedKeys ¶
GetErrorOnUnmatchedKeys returns a boolean indicating if an error should be thrown if there are keys in the config file that do not correspond to the config struct
type UnmatchedTomlKeysError ¶
UnmatchedTomlKeysError errors are returned by the Load function when ErrorOnUnmatchedKeys is set to true and there are unmatched keys in the input toml config file. The string returned by Error() contains the names of the missing keys.
func (*UnmatchedTomlKeysError) Error ¶
func (e *UnmatchedTomlKeysError) Error() string
Click to show internal directories.
Click to hide internal directories.