___ _ __ __ __
/ _ \ | '_ \ \ \ / /
| __/ | | | | \ V /
\___| |_| |_| \_/ The env package provides a structure for setting and identifying the Environment an application is running in.
import "github.com/agentstation/env"Package env provides a structure for setting and identifying the environment an application is running in.
func Set
func Set(env Environment)Set sets the current environment
type Environment
Environment represents the application environment
type Environment stringconst (
// PROD is the production environment
PROD Environment = "PROD"
// STAGE is the staging environment
STAGE Environment = "STAGE"
// DEV is the development environment
DEV Environment = "DEV"
)func Current
func Current() EnvironmentCurrent returns the current environment
func Parse
func Parse(env string) EnvironmentParse converts a string to an Environment type
func (Environment) IsDev
func (e Environment) IsDev() boolIsDev returns true if the Environment is DEV
func (Environment) IsProd
func (e Environment) IsProd() boolIsProd returns true if the Environment is PROD
func (Environment) IsStage
func (e Environment) IsStage() boolIsStage returns true if the Environment is STAGE
func (Environment) String
func (e Environment) String() stringString returns a human-readable string representation of the Environment
Generated by gomarkdoc