util

package
v1.21.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnvOrDefault

func EnvOrDefault(key string, def string) string

func FromEnvOrDefault

func FromEnvOrDefault(key string, def string) string

Attempt to retrieve a value from an environment variable if it is set. If not, use specified default value

func FromEnvOrF

func FromEnvOrF(key string, fallback func() string) string

Attempt to retrieve a value from an environment variable if it is set. If not, use fallback function to generate value.

func PanicOnError

func PanicOnError(err error)

func RandomHex

func RandomHex(length int) string

Generates a (non-cryptographically) random hex string of a given length

func RequireEnv

func RequireEnv(key string) string

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