hcl

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package hcl provides the HCL configuration decoder for CONGA applications.

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

app.RegisterDecoder(".hcl", hcl.Decode)

Key Mapping

Top-level HCL attributes match flag names using kebab-case, snake_case, or camelCase:

# config.hcl
http-port = 8080
database_url = "postgres://localhost/db"
maxRetries = 5

Blocks decode as nested maps keyed by block type; duplicate block types are rejected. Parse and semantic failures (undefined variables) wrap ErrParse, and an empty document decodes to an empty map.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrParse indicates a syntax or semantic error in HCL configuration.
	ErrParse = errors.New("hcl parse error")
)

Functions

func Decode

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

Decode decodes HCL 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