# README
Environment module
This module is used to get information about the running environment of a node.
It is also used to get the organization default configurations defined here according to the running mode.
Usage
To get information about the running environment of the node you can use one of the following:
-
use
environment.Get()
to get the information if possible. -
use
environment.MustGet()
to get information or panic on error.
To get organization defined configurations:
-
use
environment.GetConfig()
to get the organization configurations for the running mode. -
use
environment.GetConfigForMode(mode)
to get configurations for a specific mode.
Usage Example
env, err := environment.Get()
if err != nil {
log.Fatal().Err(err).Msg("could not get information about running environment")
}
config, err := environment.GetConfigForMode(env.RunningMode)
if err != nil {
log.Fatal().Err(err).Msgf("could not get configurations of mode %s", env.RunningMode)
}