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

@@ -235,6 +235,16 @@ func (g TestGroup) RESTMapper() meta.RESTMapper {
return registered.RESTMapper()
}
// ExternalGroupVersions returns all external group versions allowed for the server.
func ExternalGroupVersions() []unversioned.GroupVersion {
versions := []unversioned.GroupVersion{}
for _, g := range Groups {
gv := g.GroupVersion()
versions = append(versions, *gv)
}
return versions
}
// Get codec based on runtime.Object
func GetCodecForObject(obj runtime.Object) (runtime.Codec, error) {
kind, err := api.Scheme.ObjectKind(obj)