env

package module
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2018 License: MIT Imports: 3 Imported by: 0

README

ENV - a tiny .env wrapper

this is probably not much to use to anybody else but feel free to do whatever you want with it

Notes:
  • .env file is automatically loaded, if there is no .env file this wrapper does not care - no error is thrown
  • APP_ENV must be set to the apps current environment (development/staging/production, ...)
  • get environment variables with Get(key) and GetDefault(key, default)
  • check if production with IsProduction() or development with IsDevelopment()

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppEnvironment

func AppEnvironment() string

AppEnvironment returns the name of the current environment the app is in

func Get

func Get(key string) string

Get returns the value of the specified environment variable

func GetDefault

func GetDefault(key, defaultValue string) string

GetDefault returns the value of the specified environment variable If the variable is not defined or is empty, return the default value

func IsDevelopment

func IsDevelopment() bool

IsDevelopment returns true if the current environment is development

func IsProduction

func IsProduction() bool

IsProduction returns if the current environment is production

Types

This section is empty.

Jump to

Keyboard shortcuts

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