yaml

package
v0.21.2 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Join

func Join(resources [][]byte) []byte

Join joins YAML resources into a single YAML document. It does not validate individual resources.

func Serialize

func Serialize[T any](objs ...T) ([][]byte, error)

Serialize serializes objects into YAML documents.

func SplitDocuments added in v0.17.3

func SplitDocuments(r io.Reader) ([][]byte, error)

SplitDocuments function splits content into individual document parts represented as byte slices.

Types

type K8sEncoder added in v0.18.0

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

K8sEncoder leverages the Kubernetes YAML package (sigs.k8s.io/yaml) to provide an Encoder data structure that is friendlier to the io package.

func NewK8sEncoder added in v0.18.0

func NewK8sEncoder(out io.Writer) K8sEncoder

NewK8sEncoder creates a K8sEncoder instance that writes to out.

func (K8sEncoder) Encode added in v0.18.0

func (e K8sEncoder) Encode(v any) error

Encode marshals v into YAML and writes it to e's output stream.

Jump to

Keyboard shortcuts

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