configx

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode[T any](raw map[string]any) (T, error)

Decode converts a merged config object into a typed config struct.

func Load

func Load(opts Options) (map[string]any, error)

Load merges config sources with deterministic precedence.

func NormalizeEnv

func NormalizeEnv(prefix string, environ []string) map[string]string

NormalizeEnv extracts prefixed env vars into config keys. Example: prefix APP_, key APP_LOG_LEVEL -> log_level.

Types

type Options

type Options struct {
	Defaults map[string]any
	FilePath string
	Env      map[string]string
	Flags    map[string]string
}

Options controls deterministic config loading precedence. Precedence order: Defaults < File < Env < Flags.

Jump to

Keyboard shortcuts

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