yaml

package
v1.171.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: Apache-2.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

  • Copyright (C) 2020-2026 Arm Limited or its affiliates and Contributors. All rights reserved.
  • SPDX-License-Identifier: Apache-2.0

Package yaml preserves the existing YAML import path.

Deprecated: Use github.com/ARM-software/golang-utils/utils/serialisation/yaml.

Index

Constants

This section is empty.

Variables

IsValidYAML validates YAML strings and byte slices.

YAMLExtensions lists the file extensions considered YAML files.

Functions

func IsYAMLFile

func IsYAMLFile(extension string) bool

IsYAMLFile reports whether an extension belongs to a YAML file.

func Marshal

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

Marshal encodes a value to YAML.

func MarshalWithContext

func MarshalWithContext(ctx context.Context, v any) ([]byte, error)

MarshalWithContext encodes a value to YAML with a context-aware encoder.

func ToJSON

func ToJSON(data []byte) ([]byte, error)

ToJSON converts YAML data to JSON.

func Unmarshal

func Unmarshal(data []byte, v any) error

Unmarshal decodes YAML into a destination value.

func UnmarshallWithContext

func UnmarshallWithContext(ctx context.Context, data []byte, v any) error

UnmarshallWithContext decodes YAML with a context-aware decoder.

Types

type Decoder

type Decoder = serialisation.Decoder

Decoder decodes YAML from a reader.

func NewDecoder

func NewDecoder(ctx context.Context, r io.Reader) *Decoder

NewDecoder creates a context-aware YAML decoder.

type Encoder

type Encoder = serialisation.Encoder

Encoder writes YAML values to a writer.

func NewEncoder

func NewEncoder(ctx context.Context, w io.Writer) *Encoder

NewEncoder creates a context-aware YAML encoder.

Directories

Path Synopsis
yamltest
nofast
* Copyright (C) 2020-2026 Arm Limited or its affiliates and Contributors.
* Copyright (C) 2020-2026 Arm Limited or its affiliates and Contributors.

Jump to

Keyboard shortcuts

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