{"modulePath":"github.com/UnityTech/client-go","version":"v2.0.0+incompatible","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package serializer\n\n## Functions\n\n```go\nfunc NegotiatedSerializerWrapper(info runtime.SerializerInfo) runtime.NegotiatedSerializer\n```\n\n## Types\n\n```go\ntype CodecFactory struct {\n\t// contains filtered or unexported fields\n}\n```\nCodecFactory provides methods for retrieving codecs and serializers for specific versions and content types.\n\n```go\nfunc NewCodecFactory(scheme *runtime.Scheme) CodecFactory\n```\nNewCodecFactory provides methods for retrieving serializers for the supported wire formats and conversion wrappers to define preferred internal and external versions. In the future, as the internal version is used less, callers may instead use a defaulting serializer and only convert objects which are shared internally (Status, common API machinery). TODO: allow other codecs to be compiled in? TODO: accept a scheme interface\n\n```go\nfunc (f CodecFactory) CodecForVersions(encoder runtime.Encoder, decoder runtime.Decoder, encode runtime.GroupVersioner, decode runtime.GroupVersioner) runtime.Codec\n```\nCodecForVersions creates a codec with the provided serializer. If an object is decoded and its group is not in the list, it will default to runtime.APIVersionInternal. If encode is not specified for an object's group, the object is not converted. If encode or decode are nil, no conversion is performed.\n\n```go\nfunc (f CodecFactory) DecoderToVersion(decoder runtime.Decoder, gv runtime.GroupVersioner) runtime.Decoder\n```\nDecoderToVersion returns a decoder that targets the provided group version.\n\n```go\nfunc (f CodecFactory) EncoderForVersion(encoder runtime.Encoder, gv runtime.GroupVersioner) runtime.Encoder\n```\nEncoderForVersion returns an encoder that targets the provided group version.\n\n```go\nfunc (f CodecFactory) LegacyCodec(version ...unversioned.GroupVersion) runtime.Codec\n```\nLegacyCodec encodes output to a given API versions, and decodes output into the internal form from any recognized source. The returned codec will always encode output to JSON. If a type is not found in the list of versions an error will be returned.\n\nThis method is deprecated - clients and servers should negotiate a serializer by mime-type and invoke CodecForVersions. Callers that need only to read data should use UniversalDecoder().\n\nTODO: make this call exist only in pkg/api, and initialize it with the set of default versions.\n\n\tAll other callers will be forced to request a Codec directly.\n\n```go\nfunc (f CodecFactory) SupportedMediaTypes() []runtime.SerializerInfo\n```\nSupportedMediaTypes returns the RFC2046 media types that this factory has serializers for.\n\n```go\nfunc (f CodecFactory) UniversalDecoder(versions ...unversioned.GroupVersion) runtime.Decoder\n```\nUniversalDecoder returns a runtime.Decoder capable of decoding all known API objects in all known formats. Used by clients that do not need to encode objects but want to deserialize API objects stored on disk. Only decodes objects in groups registered with the scheme. The GroupVersions passed may be used to select alternate versions of objects to return - by default, runtime.APIVersionInternal is used. If any versions are specified, unrecognized groups will be returned in the version they are encoded as (no conversion). This decoder performs defaulting.\n\nTODO: the decoder will eventually be removed in favor of dealing with objects in their versioned form TODO: only accept a group versioner\n\n```go\nfunc (f CodecFactory) UniversalDeserializer() runtime.Decoder\n```\nUniversalDeserializer can convert any stored data recognized by this factory into a Go object that satisfies runtime.Object. It does not perform conversion. It does not perform defaulting.\n\n```go\ntype DirectCodecFactory struct {\n\tCodecFactory\n}\n```\nDirectCodecFactory provides methods for retrieving \"DirectCodec\"s, which do not do conversion.\n\n```go\nfunc (f DirectCodecFactory) DecoderToVersion(serializer runtime.Decoder, _ runtime.GroupVersioner) runtime.Decoder\n```\nDecoderToVersion returns an decoder that does not do conversion. gv is ignored.\n\n```go\nfunc (f DirectCodecFactory) EncoderForVersion(serializer runtime.Encoder, _ runtime.GroupVersioner) runtime.Encoder\n```\nEncoderForVersion returns an encoder that does not do conversion. gv is ignored.\n\n","path":"github.com/UnityTech/client-go/pkg/runtime/serializer","name":"serializer","synopsis":"","isRedistributable":true}
