Documentation ¶
Overview ¶
Package env provides a type for runtime environments.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotAllowed = errors.New("action not allowed for the environment")
ErrNotAllowed describes an error for action which is not allowed in a given environment.
Functions ¶
This section is empty.
Types ¶
type Environment ¶
type Environment string
Environment defines a runtime environment.
const ( Local Environment = "local" Test Environment = "test" Development Environment = "dev" Qa Environment = "qa" Staging Environment = "staging" Production Environment = "prod" )
Available commonly used environments.
func Parse ¶
func Parse(envName string) (Environment, error)
Parse returns an environment constant from a given string representation of it.
func (Environment) Validate ¶
func (env Environment) Validate() error
Validate checks that the environment value is valid.
Click to show internal directories.
Click to hide internal directories.