package
0.0.0-20190806085950-af561f6ff7a1
Repository: https://github.com/kylebanks/go-kit.git
Documentation: pkg.go.dev

# README

env

-- import "github.com/KyleBanks/go-kit/env/"

Package env provides application environment detection, and support for a Dev/Test/Prod environment system.

Usage

const (
	// EnvironmentVariable is the name of the environment variable to look for
	// when determining the application environment.
	EnvironmentVariable = "GO_ENV"
)

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.

# Functions

Get returns the current environment that the go application is running in, based on the environment variable.

# Constants

EnvironmentVariable is the name of the environment variable to look for when determining the application environment.

# Variables

Dev is a development environment.
Prod is a production environment.
Test is a testing environment.

# Type aliases

Environment defines the name of an environment, such as Prod or Dev.