marshal

package
v0.4.7 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalDocument

func MarshalDocument(handle *DocumentHandle, v any) ([]byte, error)

MarshalDocument writes struct field values back into the CST-backed document and returns the serialized bytes, preserving comments and formatting.

Types

type DocumentHandle

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

DocumentHandle holds the CST-backed document for round-trip editing.

func UnmarshalDocument

func UnmarshalDocument(input []byte, v any) (*DocumentHandle, error)

UnmarshalDocument parses TOML input into a CST-backed document and populates the struct pointed to by v using its `toml` struct tags.

func UnmarshalReader

func UnmarshalReader(r io.Reader, v any) (*DocumentHandle, error)

UnmarshalReader parses TOML from an io.Reader into a CST-backed document and populates the struct pointed to by v using its `toml` struct tags.

Jump to

Keyboard shortcuts

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