env

package module
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2022 License: MIT Imports: 7 Imported by: 0

README

go-env

Simple wrappers round syscall.Getenv() and syscall.Setenv() functions to provide easy getting / setting of environment variables of various types.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(key string) string

func GetArray

func GetArray(key string) []string

func GetBool

func GetBool(key string) bool

func GetBoolArray

func GetBoolArray(key string) []bool

func GetBytes

func GetBytes(key string) []byte

func GetDuration

func GetDuration(key string) time.Duration

func GetDurationArray

func GetDurationArray(key string) []time.Duration

func GetEnvArray

func GetEnvArray(key string, each func(string) error) bool

GetEnvArray gets env var and splits a slice formatted string i.e. `["hello world", key2 key3, "\"quoted\" key"]`.

func GetFloat

func GetFloat(key string) float64

func GetFloatArray

func GetFloatArray(key string) []float64

func GetInt

func GetInt(key string) int

func GetInt64

func GetInt64(key string) int64

func GetInt64Array

func GetInt64Array(key string) []int64

func GetIntArray

func GetIntArray(key string) []int

func GetSize

func GetSize(key string) bytesize.Size

func GetSizeArray

func GetSizeArray(key string) []bytesize.Size

func GetTime

func GetTime(key string) time.Time

func GetTimeArray

func GetTimeArray(key string) []time.Time

func GetUint

func GetUint(key string) uint

func GetUint64

func GetUint64(key string) uint64

func GetUint64Array

func GetUint64Array(key string) []uint64

func GetUintArray

func GetUintArray(key string) []uint

func Set

func Set(key string, value string)

func SetArray

func SetArray(key string, value []string)

func SetBool

func SetBool(key string, value bool)

func SetBoolArray

func SetBoolArray(key string, value []bool)

func SetBytes

func SetBytes(key string, value []byte)

func SetDuration

func SetDuration(key string, value time.Duration)

func SetDurationArray

func SetDurationArray(key string, value []time.Duration)

func SetEnvArray

func SetEnvArray(key string, append func(*bytes.Buffer, int), len int)

func SetFloat

func SetFloat(key string, value float64)

func SetFloatArray

func SetFloatArray(key string, value []float64)

func SetInt

func SetInt(key string, value int)

func SetInt64

func SetInt64(key string, value int64)

func SetInt64Array

func SetInt64Array(key string, value []int64)

func SetIntArray

func SetIntArray(key string, value []int)

func SetSize

func SetSize(key string, value bytesize.Size)

func SetSizeArray

func SetSizeArray(key string, value []bytesize.Size)

func SetTime

func SetTime(key string, value time.Time)

func SetTimeArray

func SetTimeArray(key string, value []time.Time)

func SetUint

func SetUint(key string, value uint)

func SetUint64

func SetUint64(key string, value uint64)

func SetUint64Array

func SetUint64Array(key string, value []uint64)

func SetUintArray

func SetUintArray(key string, value []uint)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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