Documentation ¶
Overview ¶
Package engine defines a config engine for the entire app in the dev context.
The config features:
- reads the command line arguments for the app such as authentication enabled or not.
- automatically loads the environment variables files.
- Allows setting default variables if user didn't define them.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Dev ¶
type Dev struct { *viper.Viper // used to keep default values // Passed as --secure command line arg. // If it's passed, then authentication is switched off. Secure bool HandleChange func(interface{}, error) }
Dev context's configuration engine on viper.Viper
func NewDev ¶
NewDev creates a global config for the entire application.
Automatically reads the command line arguments. Loads the environment variables.
func (*Dev) Exist ¶
Exist Checks whether the config variable exists or not If the config exists or its default value exists, then returns true.
func (*Dev) SetDefaults ¶
SetDefaults sets the default config parameters.
Click to show internal directories.
Click to hide internal directories.