Documentation
¶
Index ¶
Constants ¶
View Source
const EnvironmentKey = "ENVIRONMENT"
EnvironmentKey is the environment variable we look for to set the environment (prefixed with service name)
Variables ¶
View Source
var Module = fx.Module( "env", fx.Provide( Env, NewEnviron, ), )
Functions ¶
This section is empty.
Types ¶
type Environ ¶
func NewEnviron ¶
type Environment ¶
type Environment string
Environment is a defined environment
func Env ¶
func Env(environ Environ) Environment
Env returns the environment from the environment variables
func Local ¶ added in v2.2.0
func Local() Environment
func Production ¶ added in v2.2.0
func Production() Environment
func Test ¶ added in v2.2.0
func Test() Environment
func (Environment) IsLocal ¶
func (e Environment) IsLocal() bool
IsLocal returns true if the environment is not defined (aka local)
func (Environment) IsProduction ¶
func (e Environment) IsProduction() bool
IsProduction returns true if the environment is the production environment.
func (Environment) IsTest ¶
func (e Environment) IsTest() bool
IsTest returns true if the environment is the test environment
func (Environment) Load ¶
func (e Environment) Load(files ...string)
Load loads the environment variables from the specified files and from the standard locations
func (Environment) String ¶
func (e Environment) String() string
String returns a string version of the environment.
Click to show internal directories.
Click to hide internal directories.