env

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package env contains helper functions for setting and getting environment variables

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check()

Check checks the local environment to see that all of the environment variables specified in config are set.

func Load

func Load(env string, srcPath string, inject ...string) error

Load loading env vars from env file

Types

type Key

type Key string

Key is the key string of an environment variable.

func (Key) Lookup

func (key Key) Lookup() (string, bool)

Lookup is an alias for os.LookupEnv(string(key))

func (Key) SetBool

func (key Key) SetBool(bp *bool) error

SetBool sets the boolean address pointed to by bp to key.Value()

func (Key) SetInt

func (key Key) SetInt(ip *int) error

SetInt sets the int address pointed to by ip to key.Value().

func (Key) SetString

func (key Key) SetString(sp *string) error

SetString sets the string address pointed to by sp to key.Value().

func (Key) Value

func (key Key) Value() string

Value is an alias for os.GetEnv(string(key))

Jump to

Keyboard shortcuts

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