env_kit

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: Apache-2.0 Imports: 6 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchOsEnvArray deprecated

func FetchOsEnvArray(key string) []string

FetchOsEnvArray

fetch os env split by `,` and trim space
return not found will return []string(nil).

Deprecated: use FetchOsEnvStringSlice instead

func FetchOsEnvBool

func FetchOsEnvBool(key string, devValue bool) bool

FetchOsEnvBool

fetch os env by key.
if not found will return devValue.
return env not same as true (will be lowercase, so TRUE is same)

func FetchOsEnvInt

func FetchOsEnvInt(key string, devValue int) int

FetchOsEnvInt

fetch os env by key.
return not found will return devValue.
if not parse to int, return devValue

func FetchOsEnvInt64 added in v1.1.0

func FetchOsEnvInt64(key string, devValue int64) int64

FetchOsEnvInt64

fetch os env by key.
return not found will return devValue.
if not parse to uint, return devValue

func FetchOsEnvInt64Slice added in v1.1.0

func FetchOsEnvInt64Slice(key string) []int64

FetchOsEnvInt64Slice

fetch os env split by `,` and trim space
return not found will return []uint(nil).

func FetchOsEnvIntSlice added in v1.1.0

func FetchOsEnvIntSlice(key string) []int

FetchOsEnvIntSlice

fetch os env split by `,` and trim space
return not found will return []int(nil).

func FetchOsEnvStr

func FetchOsEnvStr(key, devValue string) string

FetchOsEnvStr

fetch os env by key.
return not found will return devValue.

func FetchOsEnvStringSlice added in v1.1.0

func FetchOsEnvStringSlice(key string) []string

FetchOsEnvStringSlice

fetch os env split by `,` and trim space
return not found will return []string(nil).

func FetchOsEnvUint added in v1.1.0

func FetchOsEnvUint(key string, devValue uint) uint

FetchOsEnvUint

fetch os env by key.
return not found will return devValue.
if not parse to uint, return devValue

func FetchOsEnvUint64 added in v1.1.0

func FetchOsEnvUint64(key string, devValue uint64) uint64

FetchOsEnvUint64

fetch os env by key.
return not found will return devValue.
if not parse to uint64, return devValue

func FetchOsEnvUint64Slice added in v1.1.0

func FetchOsEnvUint64Slice(key string) []uint64

FetchOsEnvUint64Slice

fetch os env split by `,` and trim space
return not found will return []uint(nil).

func FetchOsEnvUintSlice added in v1.1.0

func FetchOsEnvUintSlice(key string) []uint

FetchOsEnvUintSlice

fetch os env split by `,` and trim space
return not found will return []uint(nil).

func FindAllEnv4Print

func FindAllEnv4Print() string

FindAllEnv4Print

if not found will return ""

func FindAllEnv4PrintAsSort

func FindAllEnv4PrintAsSort() string

FindAllEnv4PrintAsSort

if not found will return ""

func FindAllEnv4PrintAsSortJust

func FindAllEnv4PrintAsSortJust(keySpaceJust uint) string

func FindAllEnvByPrefix

func FindAllEnvByPrefix(prefix string) map[string]string

FindAllEnvByPrefix prefix with "" will find all

find out all env by prefix
if not found will return nil

func FindAllEnvByPrefix4Print

func FindAllEnvByPrefix4Print(prefix string) string

FindAllEnvByPrefix4Print

find out all env by prefix for print
if not found will return ""

func FindEnv4PrintAsPrefixSortJust

func FindEnv4PrintAsPrefixSortJust(prefix string, keySpaceJust uint) string

FindEnv4PrintAsPrefixSortJust prefix with "" will find all keySpaceJust 0 is not left justifying

find out all env and short
if not found will return ""

func MustHasEnvSetByArray

func MustHasEnvSetByArray(t *testing.T, envs []string) bool

MustHasEnvSetByArray unit test helper env settings if not found env in envs will return true

func SetEnvBool

func SetEnvBool(key string, val bool)

func SetEnvInt added in v1.1.0

func SetEnvInt(key string, val int)

func SetEnvInt64 added in v1.1.0

func SetEnvInt64(key string, val int64)

func SetEnvInt64Slice added in v1.1.0

func SetEnvInt64Slice(key string, val []int64)

func SetEnvIntSlice added in v1.1.0

func SetEnvIntSlice(key string, val []int)

func SetEnvStr

func SetEnvStr(key string, val string)

func SetEnvStringSlice added in v1.1.0

func SetEnvStringSlice(key string, val []string)

func SetEnvU64 deprecated

func SetEnvU64(key string, val uint64)

Deprecated: use SetEnvUint64 instead

func SetEnvUint added in v1.1.0

func SetEnvUint(key string, val uint)

func SetEnvUint64 added in v1.1.0

func SetEnvUint64(key string, val uint64)

func SetEnvUint64Slice added in v1.1.0

func SetEnvUint64Slice(key string, val []uint64)

func SetEnvUintSlice added in v1.1.0

func SetEnvUintSlice(key string, val []uint)

Types

This section is empty.

Jump to

Keyboard shortcuts

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