config

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: MIT Imports: 7 Imported by: 0

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.

Jump to

Keyboard shortcuts

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