encoding

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultExpressionCodex = Codex{}

Functions

func Compact added in v0.1.4

func Compact() *prettyOpt

func Decode

func Decode(buffer []byte, codex Codex) (adapters.Node, error)

func HumanEncode added in v0.1.4

func HumanEncode(w io.Writer, root adapters.Node, opts ...HumanEncodeOption) error

HumanEncode encodes the node in a human-friendly format.

func Unnamed added in v0.1.4

func Unnamed() *hideParamName

Types

type Codex

type Codex map[string]NodeConstructor

func (*Codex) AutoRegister added in v0.1.5

func (c *Codex) AutoRegister(nodes ...adapters.AutoRegisterer) error

func (*Codex) Register added in v0.1.5

func (c *Codex) Register(name string, constructor func([]adapters.KeyNode) (adapters.Node, error)) error

type DecodeConfig

type DecodeConfig struct {
	NodeCodex Codex
}

type HumanEncodeOption added in v0.1.4

type HumanEncodeOption interface {
	// contains filtered or unexported methods
}

type Node

type Node struct {
	Children []*Node
	Key      []byte
	Scalar   []byte
	Value    any
	Type     adapters.NodeType
}

type NodeConstructor

type NodeConstructor func(keyedNodes []adapters.KeyNode) (adapters.Node, error)

type Token

type Token struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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