env

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package env has simple functions for environment variables manipulation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnvAsBool

func EnvAsBool(envKey string, defaultVal bool) bool

EnvAsBool returns the envKey as bool or the default value if missing (eq "") Panics if the value of the envKey is NOT a bool (parsing with strconv.ParseBool)

func EnvAsInt

func EnvAsInt(envKey string, defaultVal int) int

EnvAsInt returns the envKey as int or the default value if missing (eq "") Panics if the value of the envKey is NOT an integer

func EnvOrDefault

func EnvOrDefault(envKey, defaultVal string) string

EnvOrDefault will return the value of the environment variable key (envKey), or if not found (eq "") returns the default (defaultVal)

func MustEnv

func MustEnv(envKey string) string

MustEnv will return the value of the environment variable key (envKey) or panic if this is not found (eq "")

func MustEnvAsBool

func MustEnvAsBool(envKey string) bool

MustEnvAsBool returns the envKey as bool Panics if envKey is NOT set Panics if the value of the envKey is NOT a bool (parsing with strconv.ParseBool)

func MustEnvAsInt

func MustEnvAsInt(envKey string) int

MustEnvAsInt returns the envKey as int or panics if missing (eq "") Panics if the value of the envKey is NOT an integer

Types

This section is empty.

Jump to

Keyboard shortcuts

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