encode

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 10 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Encode

func Encode(obj runtime.Object, format string) ([]byte, error)

Encode converts the provided object to the specified format and returns a byte slice of the encoded data.

func EncoderFor

func EncoderFor(format string, obj runtime.Object) (runtime.Encoder, error)

EncoderFor gets the appropriate encoder for the specified format. Only objects registered in the velero scheme, or objects with their TypeMeta set will have valid encoders.

func To added in v1.12.0

func To(obj runtime.Object, format string, w io.Writer) error

To converts the provided object to the specified format and writes the encoded data to the provided io.Writer.

func ToJSONGzip added in v1.12.0

func ToJSONGzip(data interface{}, desc string) (*bytes.Buffer, []error)

ToJSONGzip takes arbitrary Go data and encodes it to GZip compressed JSON in a buffer, as well as a description of the data to put into an error should encoding fail.

Types

This section is empty.

Jump to

Keyboard shortcuts

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