env

package
v0.78.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 15, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrBadEnvironmentVariableSet occurs when the AGORA_ENVIRONMENT environment variable is set to an invalid value
	ErrBadEnvironmentVariableSet = errors.New("environment variable AGORA_ENVIRONMENT was not 'prod', 'dev', or 'test'")
)

Functions

This section is empty.

Types

type AgoraEnvironment

type AgoraEnvironment string

AgoraEnvironment is used to determine which environment the application is currently running in

const (
	// AgoraEnvironmentProd is the production environment
	AgoraEnvironmentProd AgoraEnvironment = "prod"

	// AgoraEnvironmentDev is the development environment
	AgoraEnvironmentDev AgoraEnvironment = "dev"

	// AgoraEnvironmentTest is meant to be used in go tests
	AgoraEnvironmentTest AgoraEnvironment = "test"
)

func FromEnvVariable

func FromEnvVariable() (AgoraEnvironment, error)

FromEnvVariable will try to retrieve the environment variable AGORA_ENVIRONMENT. If the value is not 'prod', 'dev', or 'test', it will return an error

func (AgoraEnvironment) IsValid

func (env AgoraEnvironment) IsValid() bool

IsValid returns true if the AgoraEnvironment is valid.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL