serializer

package
v0.0.0-...-f0fc148 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Serializer

type Serializer interface {
	// DecodeInto takes byte content and a target object to serialize the data into
	DecodeInto(content []byte, obj runtime.Object) error
	// DecodeFileInto takes a file path and a target object to serialize the data into
	DecodeFileInto(filePath string, obj runtime.Object) error

	// Decode takes byte content and returns the target object
	Decode(content []byte, internal bool) (runtime.Object, error)
	// DecodeFile takes a file path and returns the target object
	DecodeFile(filePath string, internal bool) (runtime.Object, error)

	// EncodeYAML encodes the specified object for a specific version to YAML bytes
	EncodeYAML(obj runtime.Object) ([]byte, error)
	// EncodeJSON encodes the specified object for a specific version to pretty JSON bytes
	EncodeJSON(obj runtime.Object) ([]byte, error)

	// DefaultInternal populates the given internal object with the preferred external version's defaults
	DefaultInternal(cfg runtime.Object) error

	// Scheme provides access to the underlying runtime.Scheme
	Scheme() *runtime.Scheme
}

Serializer is an interface providing high-level decoding/encoding functionality for types registered in a *runtime.Scheme

func NewSerializer

func NewSerializer(scheme *runtime.Scheme, codecs *k8sserializer.CodecFactory) Serializer

NewSerializer constructs a new serializer based on a scheme, and optionally a codecfactory

Jump to

Keyboard shortcuts

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