util

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Float64Or

func Float64Or(envVar string, def float64) float64

Float64Or get the envVar as float64 otherwise the default

func Int32Or

func Int32Or(envVar string, def int32) int32

Int32Or get the envVar as int32 otherwise the default

func Int64Or

func Int64Or(envVar string, def int64) int64

Int64Or get the envVar as int64 otherwise the default

func RandomBytes

func RandomBytes(len int) ([]byte, error)

RandomBytes generates a random bytes of len len or error

func RandomString

func RandomString(len int) (string, error)

RandomString generates a random base64 string of length len or err

func RequireFloat64

func RequireFloat64(envVar string) float64

RequireFloat64 returns the env variable as int64 or panic

func RequireValue

func RequireValue(envVar string) string

RequireValue returns the env Value or panic if none exists

func Value

func Value(envVar string) string

Value returns the environment value with white space trimmed

func ValueOr

func ValueOr(envVar, def string) string

ValueOr returns the value of Value or default if none exists

Types

This section is empty.

Jump to

Keyboard shortcuts

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