configcodec

package
v1.131.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(data []byte, out any) error

Decode decodes the given YAML or JSON data into the provided output structure, expanding environment macros and processing environment overrides. It also validates the resulting configuration.

func Encode

func Encode(cfg any) ([]byte, error)

Encode encodes the given configuration structure into YAML format.

func MustDecode

func MustDecode(data []byte, out any)

MustDecode decodes the given YAML or JSON data into the provided output structure, panicking if an error occurs. It is a convenience wrapper around Decode.

Types

type Validator

type Validator interface {
	Validate() error
}

Validator is an interface that types can implement to provide custom validation logic.

Jump to

Keyboard shortcuts

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