environment

package
Version: v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Environment    = "ENVIRONMENT"
	Port           = "PORT"
	MongoHost      = "MONGO_HOST"
	MongoDatabase  = "MONGO_DATABASE"
	MongoUser      = "MONGO_USER"
	MongoPassword  = "MONGO_PASSWORD"
	JWTSecret      = "JWT_SECRET"
	SendgridAPIKey = "SENDGRID_API_KEY"
)

names of env vars

View Source
const DefaultEnvVarValue = "not set"

DefaultEnvVarValue is the value returned by Get when the env var is not set

Variables

This section is empty.

Functions

This section is empty.

Types

type Env

type Env struct {
	// contains filtered or unexported fields
}

Env is a struct to store environment variables in an immutable collection

func NewEnv

func NewEnv(logger *zap.Logger) *Env

NewEnv creates an Env with loaded environment variables

func (*Env) Get

func (env *Env) Get(variableName string) string

Get returns an environment variable with the specified name

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL