{"modulePath":"github.com/UnityTech/client-go","version":"v2.0.0+incompatible","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package versioning\n\n## Functions\n\n```go\nfunc NewCodec(\n\tencoder runtime.Encoder,\n\tdecoder runtime.Decoder,\n\tconvertor runtime.ObjectConvertor,\n\tcreater runtime.ObjectCreater,\n\tcopier runtime.ObjectCopier,\n\ttyper runtime.ObjectTyper,\n\tdefaulter runtime.ObjectDefaulter,\n\tencodeVersion runtime.GroupVersioner,\n\tdecodeVersion runtime.GroupVersioner,\n) runtime.Codec\n```\nNewCodec 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.\n\n```go\nfunc NewCodecForScheme(\n\n\tscheme *runtime.Scheme,\n\tencoder runtime.Encoder,\n\tdecoder runtime.Decoder,\n\tencodeVersion runtime.GroupVersioner,\n\tdecodeVersion runtime.GroupVersioner,\n) runtime.Codec\n```\nNewCodecForScheme is a convenience method for callers that are using a scheme.\n\n```go\nfunc NewDefaultingCodecForScheme(\n\n\tscheme *runtime.Scheme,\n\tencoder runtime.Encoder,\n\tdecoder runtime.Decoder,\n\tencodeVersion runtime.GroupVersioner,\n\tdecodeVersion runtime.GroupVersioner,\n) runtime.Codec\n```\nNewDefaultingCodecForScheme is a convenience method for callers that are using a scheme.\n\n## Types\n\n```go\ntype DirectDecoder struct {\n\truntime.Decoder\n}\n```\nDirectDecoder clears the group version kind of a deserialized object.\n\n```go\nfunc (d DirectDecoder) Decode(data []byte, defaults *unversioned.GroupVersionKind, into runtime.Object) (runtime.Object, *unversioned.GroupVersionKind, error)\n```\nDecode does not do conversion. It removes the gvk during deserialization.\n\n```go\ntype DirectEncoder struct {\n\truntime.Encoder\n\truntime.ObjectTyper\n}\n```\nDirectEncoder serializes an object and ensures the GVK is set.\n\n```go\nfunc (e DirectEncoder) Encode(obj runtime.Object, stream io.Writer) error\n```\nEncode does not do conversion. It sets the gvk during serialization.\n\n","path":"github.com/UnityTech/client-go/pkg/runtime/serializer/versioning","name":"versioning","synopsis":"","isRedistributable":true}
