yaml

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2025 License: Apache-2.0, BSD-3-Clause, MIT Imports: 1 Imported by: 56

README

goyaml.v3

This package provides type and function aliases for the go.yaml.in/yaml/v3 package (which is compatible with gopkg.in/yaml.v3).

Purpose

The purpose of this package is to:

  1. Provide a transition path for users migrating from the sigs.k8s.io/yaml package to direct usage of go.yaml.in/yaml/v3
  2. Maintain compatibility with existing code while encouraging migration to the upstream package
  3. Reduce maintenance overhead by delegating to the upstream implementation

Usage

Instead of importing this package directly, you should migrate to using go.yaml.in/yaml/v3 directly:

// Old way
import "sigs.k8s.io/yaml/goyaml.v3"

// Recommended way
import "go.yaml.in/yaml/v3"

Available Types and Functions

All public types and functions from go.yaml.in/yaml/v3 are available through this package:

Types
  • Unmarshaler - Interface for custom unmarshaling behavior
  • Marshaler - Interface for custom marshaling behavior
  • IsZeroer - Interface to check if an object is zero
  • Decoder - Reads and decodes YAML values from an input stream
  • Encoder - Writes YAML values to an output stream
  • TypeError - Error returned by Unmarshal for decoding issues
  • Node - Represents a YAML node in the document
  • Kind - Represents the kind of a YAML node
  • Style - Represents the style of a YAML node
Functions
  • Unmarshal - Decodes YAML data into a Go value
  • Marshal - Serializes a Go value into YAML
  • NewDecoder - Creates a new Decoder
  • NewEncoder - Creates a new Encoder

Migration Guide

To migrate from this package to go.yaml.in/yaml/v3:

  1. Update your import statements:

    // From
    import "sigs.k8s.io/yaml/goyaml.v3"
    
    // To
    import "go.yaml.in/yaml/v3"
    
  2. No code changes should be necessary as the API is identical

  3. Update your go.mod file to include the dependency:

    require go.yaml.in/yaml/v3 v3.0.3
    

Deprecation Notice

All types and functions in this package are marked as deprecated. You should migrate to using go.yaml.in/yaml/v3 directly.

Documentation

Index

Constants

View Source
const (
	// DocumentNode represents a YAML document node.
	// Deprecated: Use go.yaml.in/yaml/v3.DocumentNode directly.
	DocumentNode = gopkg_yaml.DocumentNode

	// SequenceNode represents a YAML sequence node.
	// Deprecated: Use go.yaml.in/yaml/v3.SequenceNode directly.
	SequenceNode = gopkg_yaml.SequenceNode

	// MappingNode represents a YAML mapping node.
	// Deprecated: Use go.yaml.in/yaml/v3.MappingNode directly.
	MappingNode = gopkg_yaml.MappingNode

	// ScalarNode represents a YAML scalar node.
	// Deprecated: Use go.yaml.in/yaml/v3.ScalarNode directly.
	ScalarNode = gopkg_yaml.ScalarNode

	// AliasNode represents a YAML alias node.
	// Deprecated: Use go.yaml.in/yaml/v3.AliasNode directly.
	AliasNode = gopkg_yaml.AliasNode
)

Constants for Kind type from go.yaml.in/yaml/v3

View Source
const (
	// TaggedStyle represents a tagged YAML style.
	// Deprecated: Use go.yaml.in/yaml/v3.TaggedStyle directly.
	TaggedStyle = gopkg_yaml.TaggedStyle

	// DoubleQuotedStyle represents a double-quoted YAML style.
	// Deprecated: Use go.yaml.in/yaml/v3.DoubleQuotedStyle directly.
	DoubleQuotedStyle = gopkg_yaml.DoubleQuotedStyle

	// SingleQuotedStyle represents a single-quoted YAML style.
	// Deprecated: Use go.yaml.in/yaml/v3.SingleQuotedStyle directly.
	SingleQuotedStyle = gopkg_yaml.SingleQuotedStyle

	// LiteralStyle represents a literal YAML style.
	// Deprecated: Use go.yaml.in/yaml/v3.LiteralStyle directly.
	LiteralStyle = gopkg_yaml.LiteralStyle

	// FoldedStyle represents a folded YAML style.
	// Deprecated: Use go.yaml.in/yaml/v3.FoldedStyle directly.
	FoldedStyle = gopkg_yaml.FoldedStyle

	// FlowStyle represents a flow YAML style.
	// Deprecated: Use go.yaml.in/yaml/v3.FlowStyle directly.
	FlowStyle = gopkg_yaml.FlowStyle
)

Constants for Style type from go.yaml.in/yaml/v3

Variables

View Source
var (
	// Unmarshal decodes the first document found within the in byte slice and assigns decoded values into the out value.
	// Deprecated: Use go.yaml.in/yaml/v3.Unmarshal directly.
	Unmarshal = gopkg_yaml.Unmarshal

	// Marshal serializes the value provided into a YAML document.
	// Deprecated: Use go.yaml.in/yaml/v3.Marshal directly.
	Marshal = gopkg_yaml.Marshal

	// NewDecoder returns a new decoder that reads from r.
	// Deprecated: Use go.yaml.in/yaml/v3.NewDecoder directly.
	NewDecoder = gopkg_yaml.NewDecoder

	// NewEncoder returns a new encoder that writes to w.
	// Deprecated: Use go.yaml.in/yaml/v3.NewEncoder directly.
	NewEncoder = gopkg_yaml.NewEncoder
)

Function aliases for public functions from go.yaml.in/yaml/v3

Functions

This section is empty.

Types

type Decoder

type Decoder = gopkg_yaml.Decoder

Decoder reads and decodes YAML values from an input stream. Deprecated: Use go.yaml.in/yaml/v3.Decoder directly.

type Encoder

type Encoder = gopkg_yaml.Encoder

Encoder writes YAML values to an output stream. Deprecated: Use go.yaml.in/yaml/v3.Encoder directly.

type IsZeroer

type IsZeroer = gopkg_yaml.IsZeroer

IsZeroer is used to check whether an object is zero to determine whether it should be omitted when marshaling with the omitempty flag. One notable implementation is time.Time. Deprecated: Use go.yaml.in/yaml/v3.IsZeroer directly.

type Kind

type Kind = gopkg_yaml.Kind

Kind represents the kind of a YAML node. Deprecated: Use go.yaml.in/yaml/v3.Kind directly.

type Marshaler

type Marshaler = gopkg_yaml.Marshaler

Marshaler is implemented by types to customize their behavior when being marshaled into a YAML document. Deprecated: Use go.yaml.in/yaml/v3.Marshaler directly.

type Node

type Node = gopkg_yaml.Node

Node represents a YAML node in the document. Deprecated: Use go.yaml.in/yaml/v3.Node directly.

type Style

type Style = gopkg_yaml.Style

Style represents the style of a YAML node. Deprecated: Use go.yaml.in/yaml/v3.Style directly.

type TypeError

type TypeError = gopkg_yaml.TypeError

TypeError is returned by Unmarshal when one or more fields in the YAML document cannot be properly decoded. Deprecated: Use go.yaml.in/yaml/v3.TypeError directly.

type Unmarshaler

type Unmarshaler = gopkg_yaml.Unmarshaler

Unmarshaler is implemented by types to customize their behavior when being unmarshaled from a YAML document. Deprecated: Use go.yaml.in/yaml/v3.Unmarshaler directly.

Jump to

Keyboard shortcuts

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