env

package
v12.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2019 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Port is the PORT environment variable or 8080 if missing.
	// Used to open the tcp listener for our web server.
	Port string
	// DSN is the DSN environment variable or mongodb://localhost:27017 if missing.
	// Used to connect to the mongodb.
	DSN string
)

Functions

func Load

func Load(envFileName string)

Load loads environment variables that are being used across the whole app. Loading from file(s), i.e .env or dev.env

Example of a 'dev.env': PORT=8080 DSN=mongodb://localhost:27017

After `Load` the callers can get an environment variable via `os.Getenv`.

Types

This section is empty.

Jump to

Keyboard shortcuts

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