helpers

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package helpers contains small utility methods that don't belong anywhere else.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEnvWithDefault

func GetEnvWithDefault[T any](name string, defaultValue T, validator ...func(T) bool) (value T)

GetEnvWithDefault reads an environment variable, parses it to the specified type T, and returns the parsed value. If the environment variable is empty, unparsable, or fails validation, the defaultValue is returned instead.

Supported types: string, int, bool, float64, time.Duration. For unsupported types, the default value is always returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

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