envutil

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package envutil provides shared helpers for environment variable parsing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(key, fallback string) string

Get returns the env var value or fallback when unset/empty.

func GetBoolLoose

func GetBoolLoose(key string, fallback bool) bool

GetBoolLoose parses common bool strings (true/1/yes/on) and uses fallback when unset.

func GetBoolStrict

func GetBoolStrict(key string, fallback bool) bool

GetBoolStrict parses bool values using strconv.ParseBool semantics.

func GetDuration

func GetDuration(key string, fallback time.Duration) time.Duration

GetDuration parses a duration env var, returning fallback when unset/invalid.

func GetDurationOrSeconds

func GetDurationOrSeconds(key string, fallback time.Duration) time.Duration

GetDurationOrSeconds parses duration first; if that fails, parses integer seconds.

func GetFloat

func GetFloat(key string, fallback float64) float64

GetFloat returns the parsed float env var or fallback on missing/invalid values.

func GetInt

func GetInt(key string, fallback int) int

GetInt returns the parsed integer env var or fallback on missing/invalid values.

func LookupBoolLoose

func LookupBoolLoose(key string) (bool, bool)

LookupBoolLoose looks up a bool env var and reports whether a non-empty value was present.

Types

This section is empty.

Jump to

Keyboard shortcuts

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