yaml

package
v2.10.1 Latest Latest
Warning

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

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

Documentation

Overview

Package yaml is the YAML codec: yaml.v3 to read, yamlfmt to write, so a file saved by Cartograph keeps the two-space indentation the vaults are written in by hand.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Codec

type Codec struct{}

Codec is the YAML codec. The zero value is ready to use.

func New

func New() Codec

New returns the YAML codec.

func (Codec) Decode

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

func (Codec) DecodeAll

func (Codec) DecodeAll(text []byte) ([]codec.Document, error)

DecodeAll splits a file on "---". A file holding exactly one manifest keeps its original bytes, so what is committed is the text that was written; only a file that holds several is re-marshalled per document, since there is no other way to give each its own text. An empty document (a stray "---", trailing comments) is skipped: it names no kind and is not an attempt at one.

func (Codec) DecodeInto

func (Codec) DecodeInto(text []byte, v any) error

func (Codec) Encode

func (Codec) Encode(v any) ([]byte, error)

func (Codec) Extension

func (Codec) Extension() string

func (Codec) Name

func (Codec) Name() string

Jump to

Keyboard shortcuts

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