Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config interface {
// Load loads the configuration from a source.
Load() error
// Set sets/override the value for a given key in the configuration.
Set(key string, value any)
// Get retrieves the value associated with the given key.
// on json driver if multiple file passed you must append
// file name to access setting .e.g. file1.some.field
Get(key string) any
// Exists checks if a given key exists in the configuration.
Exists(key string) bool
// Cast retrieves the value associated with the given key and returns it
// as a gocast.Caster, which allows for type-safe casting.
Cast(key string) gocast.Caster
}
Config is an interface that defines methods for loading, setting, getting, checking existence, and casting configuration values.
func NewEnv ¶
NewEnv creates a new Config instance that loads configuration from environment variables. It accepts an optional list of file paths to load additional environment variables from. Returns a Config instance or an error if loading fails.
Click to show internal directories.
Click to hide internal directories.