versioning

package
v0.0.0-...-01f179d Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCodec

func NewCodec(
	encoder runtime.Encoder,
	decoder runtime.Decoder,
	convertor runtime.ObjectConvertor,
	creater runtime.ObjectCreater,
	typer runtime.ObjectTyper,
	defaulter runtime.ObjectDefaulter,
	encodeVersion runtime.GroupVersioner,
	decodeVersion runtime.GroupVersioner,
	originalSchemeName string,
) runtime.Codec

NewCodec takes objects in their internal versions and converts them to external versions before serializing them. It assumes the serializer provided to it only deals with external versions. This class is also a serializer, but is generally used with a specific version.

func NewDefaultingCodecForScheme

func NewDefaultingCodecForScheme(

	scheme *runtime.Scheme,
	encoder runtime.Encoder,
	decoder runtime.Decoder,
	encodeVersion runtime.GroupVersioner,
	decodeVersion runtime.GroupVersioner,
) runtime.Codec

NewDefaultingCodecForScheme is a convenience method for callers that are using a scheme.

Types

type DirectDecoder

type DirectDecoder struct {
	runtime.Decoder
}

DirectDecoder clears the group version kind of a deserialized object.

func (DirectDecoder) Decode

Decode does not do conversion. It removes the gvk during deserialization.

type DirectEncoder

type DirectEncoder struct {
	Version runtime.GroupVersioner
	runtime.Encoder
	runtime.ObjectTyper
}

DirectEncoder serializes an object and ensures the GVK is set.

func (DirectEncoder) Encode

func (e DirectEncoder) Encode(obj runtime.Object, stream io.Writer) error

Encode does not do conversion. It sets the gvk during serialization.

Jump to

Keyboard shortcuts

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