Make DataVersionAndKind public on runtime.Scheme

Add a new ObjectTyper interface that clients can depend on for
converting between data and object to version and kind.
This commit is contained in:
Clayton Coleman
2014-10-29 12:10:55 -04:00
parent 3b76b25e7d
commit 58715527aa
3 changed files with 16 additions and 0 deletions

View File

@@ -33,6 +33,13 @@ type Codec interface {
Encoder
}
// ObjectTyper contains methods for extracting the APIVersion and Kind
// of objects.
type ObjectTyper interface {
DataVersionAndKind([]byte) (version, kind string, err error)
ObjectVersionAndKind(Object) (version, kind string, err error)
}
// ResourceVersioner provides methods for setting and retrieving
// the resource version from an API object.
type ResourceVersioner interface {