goenv

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2022 License: MIT Imports: 6 Imported by: 0

README

goenv

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(key string, value bool) bool

Bool returns the boolean value represented by the string.

func Get

func Get(key string, value string) string

Get a value from the ENV. If it doesn't exist the default value will be returned.

func Int

func Int(key string, value int) int

Int returns the integer value represented by the string.

func Load

func Load(files ...string) error

Load .env files. Files will be loaded in the same order that are received. Redefined vars will override previously existing values. IE: envy.Load(".env", "test_env/.env") will result in DIR=test_env If no arg passed, it will try to load a .env file.

func MustGet

func MustGet(key string) (string, error)

MustGet get a value from the ENV. If it doesn't exist an error will be returned

func MustSet

func MustSet(key string, value string) error

MustSet the value into the underlying ENV, as well as envy. This may return an error if there is a problem setting the underlying ENV value.

func Reload

func Reload()

Reload the ENV variables. Useful if an external ENV manager has been used

func Set

func Set(key string, value string)

Set a value into the ENV. This is NOT permanent. It will only affect values accessed through envy.

Types

This section is empty.

Jump to

Keyboard shortcuts

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