Add a streaming and "raw" abstraction to codec factory

This commit is contained in:
Clayton Coleman
2016-03-21 12:40:41 -04:00
parent 2bb6f74bf9
commit 54eaa56b92
10 changed files with 299 additions and 87 deletions

View File

@@ -40,9 +40,15 @@ const OldestVersion = "v1"
// with a set of versions to choose.
var Versions = []string{"v1"}
var Codec = versioning.NewCodecForScheme(
api.Scheme,
json.NewYAMLSerializer(json.DefaultMetaFactory, api.Scheme, runtime.ObjectTyperToTyper(api.Scheme)),
[]unversioned.GroupVersion{{Version: Version}},
[]unversioned.GroupVersion{{Version: runtime.APIVersionInternal}},
)
var Codec runtime.Codec
func init() {
yamlSerializer := json.NewYAMLSerializer(json.DefaultMetaFactory, api.Scheme, runtime.ObjectTyperToTyper(api.Scheme))
Codec = versioning.NewCodecForScheme(
api.Scheme,
yamlSerializer,
yamlSerializer,
[]unversioned.GroupVersion{{Version: Version}},
[]unversioned.GroupVersion{{Version: runtime.APIVersionInternal}},
)
}