structured

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package structured is the structured tier (docs/SPEC.md §10): extractors that parse a format instead of reading it line by line, so a def binds to a node's exact extent. It lives outside the root module because it depends on format parsers; the root's config tier keeps working without it, in line mode.

YAML is the first format. A directive on a key's line binds that key's entry: a scalar (including a multi-line block scalar) as its value, a mapping or sequence as its whole extent. A directive on its own line binds the next entry. Register it ahead of the built-in tiers:

docsync.New(docsync.WithExtractor(structured.YAML()))

Index

Constants

This section is empty.

Variables

View Source
var ErrHCL = errors.New("structured: hcl parse failed; fell back to line mode")

ErrHCL wraps a parse failure; the file then falls back to the heuristic code tier so no directive is lost.

View Source
var ErrHCLPick = errors.New("structured: hcl pick path not found")

ErrHCLPick is returned when the path names nothing in the file.

View Source
var ErrTOML = errors.New("structured: toml parse failed; fell back to line mode")

ErrTOML wraps a parse failure; the file then falls back to the line-mode config tier so no directive is lost.

View Source
var ErrYAML = errors.New("structured: yaml parse failed; fell back to line mode")

ErrYAML wraps a parse failure; the file then falls back to the line-mode config tier so no directive is lost.

Functions

func All

func All() []extract.Extractor

All returns every structured tier, for docsync.WithExtractor(All()...).

func HCL

func HCL() extract.Extractor

HCL returns the HCL extractor.

func HCLPicker

func HCLPicker() docsync.Picker

HCLPicker returns the `hcl:` scheme for docsync.WithPicker.

func TOML

func TOML() extract.Extractor

TOML returns the TOML extractor.

func YAML

func YAML() extract.Extractor

YAML returns the YAML extractor.

Types

This section is empty.

Jump to

Keyboard shortcuts

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