yamlprint

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const DefaultIndent = 2

Variables

This section is empty.

Functions

func FromJSON

func FromJSON(v any) (any, error)

FromJSON converts a JSON-tagged value into a generic document for YAML.

Types

type Encoder

type Encoder struct {
	Indent int
}

Encoder marshals values to YAML using go.yaml.in/yaml/v4.

func New

func New() Encoder

func (Encoder) Marshal

func (e Encoder) Marshal(v any) ([]byte, error)

Marshal encodes v as YAML.

func (Encoder) Write

func (e Encoder) Write(w io.Writer, v any) error

Write marshals v and writes it to w.

Jump to

Keyboard shortcuts

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