env

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolAdapter

func BoolAdapter(str string) (bool, error)

func F64Adapter

func F64Adapter(str string) (float64, error)

func GetBoolEnvDef

func GetBoolEnvDef(key string, defV bool) bool

func GetBoolEnvOrFatal

func GetBoolEnvOrFatal(key string) bool

func GetEnvOrDef

func GetEnvOrDef[T any](key string, defV T, adapters ...Adapter[T]) T

func GetEnvOrFatal

func GetEnvOrFatal[T any](key string, adapters ...Adapter[T]) T

func GetF64EnvDef

func GetF64EnvDef(key string, defV float64) float64

func GetF64EnvOrFatal

func GetF64EnvOrFatal(key string) float64

func GetIntEnvDef

func GetIntEnvDef(key string, defV int) int

func GetIntEnvOrFatal

func GetIntEnvOrFatal(key string) int

func GetStringEnv

func GetStringEnv(key string, defV string) string

func GetStringEnvOrFatal

func GetStringEnvOrFatal(key string) string

func IntAdapter

func IntAdapter(str string) (int, error)

func StrAdapter

func StrAdapter(str string) (string, error)

Types

type Adapter

type Adapter[T any] func(str string) (T, error)

Jump to

Keyboard shortcuts

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