Documentation
¶
Overview ¶
Package env provides application environment detection, and support for a Dev/Test/Prod environment system.
Index ¶
Constants ¶
View Source
const ( // EnvironmentVariable is the name of the environment variable to look for // when determining the application environment. EnvironmentVariable = "GO_ENV" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Environment ¶
type Environment string
Environment defines the name of an environment, such as Prod or Dev.
var ( // Dev is a development environment. Dev Environment = "DEV" // Test is a testing environment. Test Environment = "TEST" // Prod is a production environment. Prod Environment = "PROD" )
func Get ¶
func Get() Environment
Get returns the current environment that the go application is running in, based on the environment variable. If no environment variable is found, or it is not one of Dev/Test/Prod, the default (Dev) will be returned.
Click to show internal directories.
Click to hide internal directories.