envcfg

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package envcfg reads process environment values with explicit fallbacks. Parsing stays independent of service startup, telemetry and transports.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolEnv

func BoolEnv(key string) (bool, bool)

BoolEnv parses a boolean environment variable. It returns the parsed boolean value and true if parsing succeeded. Returns false, false if the variable is not set or parsing failed.

func EnvDuration

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

EnvDuration parses a duration environment variable, falling back when unset or invalid.

func EnvInt

func EnvInt(key string, fallback int) int

EnvInt parses an integer environment variable, falling back when unset or invalid.

func EnvOr

func EnvOr(key, fallback string) string

EnvOr returns the value of an environment variable or a fallback if not set. If the environment variable is set to a non-empty value, it returns that value. Otherwise, it returns the provided fallback value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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