Documentation
¶
Overview ¶
Package config provides a generic, reflection-based configuration loader that populates structs from environment variables using struct tags.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustLoad ¶
func MustLoad[T any]() T
MustLoad loads environment variables into a struct of type T based on struct tags. It panics if any required variable is missing and has no default.
Supported struct tags:
env:"VAR_NAME" — the environment variable to read default:"value" — fallback value when the env var is empty required:"true" — panic if missing and no default (this is the default behavior) required:"false" — leave the zero value if missing and no default
Supported field types: string, int, int64, float64, bool, time.Duration, []string.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.