env

package
v0.0.0-...-af561f6 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2019 License: MIT Imports: 1 Imported by: 0

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.

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.

Jump to

Keyboard shortcuts

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