yaml

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package yaml provides the YAML configuration decoder for CONGA applications.

Register Decode with conga.App.RegisterDecoder to enable YAML configuration support:

app.RegisterDecoder(".yaml", yaml.Decode)
app.RegisterDecoder(".yml", yaml.Decode)

Key Mapping

A top-level YAML key matches a flag's config tag as written or, when it has no tag, the flag name spelled in the app's key casing (conga.ConfigKeyCase, kebab-case by default). Other spellings and letter cases are unknown fields:

# config.yaml
http-port: 8080
database-url: "postgres://localhost/db"
max-retries: 5

Parse failures wrap ErrParse, and an empty document decodes to an empty map.

Numbers and timestamps

Integers decode to int, or to uint64 above the int64 range. A plain integer literal outside both 64-bit ranges wraps ErrParse instead of decoding to an approximate float64 or a string. Unquoted timestamps decode to time.Time, which binds to a time.Time flag and reaches a string flag in RFC 3339 form.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrParse indicates a syntax or parsing error in YAML configuration.
	ErrParse = errors.New("yaml parse error")
)

Functions

func Decode

func Decode(data []byte) (map[string]any, error)

Decode decodes YAML bytes into the generic map[string]any structure the configuration engine matches against flag bindings.

Types

This section is empty.

Jump to

Keyboard shortcuts

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