protoyaml

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Overview

Package protoyaml is a frozen, internal helper for decoding protobuf query plan data as YAML/JSON. It is retained only for downstream compatibility: spanner-mycli pins the exact bytes produced by Marshal, so the output format must not change.

The Marshal output format was never a designed artifact. It is an accident of reflection-based encoding (goccy/go-yaml over the protobuf message via UseJSONMarshaler) rather than a deliberate, canonical mapping. New code should use github.com/apstndb/protoyaml, which implements the canonical protojson-over-YAML mapping.

This package will be removed in v0.3.0 once spanner-mycli has migrated.

Deprecated: Use github.com/apstndb/protoyaml instead. This package is frozen for downstream compatibility and will be removed in v0.3.0.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal deprecated

func Marshal(m proto.Message, opts ...yaml.EncodeOption) ([]byte, error)

Marshal encodes a protobuf message as YAML using reflection-based encoding.

Deprecated: The output format is an accident of reflection-based encoding, not a designed artifact. This package is frozen for downstream compatibility (spanner-mycli pins its exact output) and will be removed in v0.3.0. New code should use github.com/apstndb/protoyaml.Marshal, which produces canonical protojson-over-YAML output.

func Unmarshal deprecated

func Unmarshal(b []byte, result proto.Message) error

Unmarshal parses YAML bytes into a protobuf message.

Deprecated: Use github.com/apstndb/protoyaml.Unmarshal instead. This package is frozen for downstream compatibility and will be removed in v0.3.0.

func UnmarshalJSON deprecated added in v0.1.5

func UnmarshalJSON(j []byte, result proto.Message) error

UnmarshalJSON unmarshals JSON bytes into a protobuf message with this package's decode options.

Deprecated: Use github.com/apstndb/protoyaml.UnmarshalJSON instead. This package is frozen for downstream compatibility and will be removed in v0.3.0.

func YAMLToJSON deprecated added in v0.1.5

func YAMLToJSON(y []byte) ([]byte, error)

YAMLToJSON converts YAML bytes into JSON bytes for protojson.Unmarshal.

Deprecated: Use github.com/apstndb/protoyaml.YAMLToJSON instead. This package is frozen for downstream compatibility and will be removed in v0.3.0.

Types

This section is empty.

Jump to

Keyboard shortcuts

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