Documentation
¶
Overview ¶
Package envutil provides utilities for reading and validating environment variables.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetIntFromEnv ¶
GetIntFromEnv is a generic helper that reads an integer value from an environment variable, validates it against min/max bounds, and returns a default value if invalid. This follows the configuration helper pattern from pkg/workflow/config_helpers.go.
Parameters:
- envVar: The environment variable name (e.g., "GH_AW_MAX_CONCURRENT_DOWNLOADS")
- defaultValue: The default value to return if env var is not set or invalid
- minValue: Minimum allowed value (inclusive)
- maxValue: Maximum allowed value (inclusive)
- log: Optional logger for debug output
Returns the parsed integer value, or defaultValue if:
- Environment variable is not set
- Value cannot be parsed as an integer
- Value is outside the [minValue, maxValue] range
Invalid values trigger warning messages to stderr.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.