Use a strong type for UID fields

This commit is contained in:
Tim Hockin
2015-01-14 13:53:43 -08:00
parent 4e539001df
commit e86d4cd3c6
31 changed files with 182 additions and 170 deletions

View File

@@ -18,6 +18,7 @@ package meta
import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/runtime"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
)
// VersionInterfaces contains the interfaces one should use for dealing with types of a particular version.
@@ -36,8 +37,8 @@ type Interface interface {
SetNamespace(namespace string)
Name() string
SetName(name string)
UID() string
SetUID(uid string)
UID() util.UID
SetUID(uid util.UID)
APIVersion() string
SetAPIVersion(version string)
Kind() string
@@ -71,8 +72,8 @@ type MetadataAccessor interface {
Name(obj runtime.Object) (string, error)
SetName(obj runtime.Object, name string) error
UID(obj runtime.Object) (string, error)
SetUID(obj runtime.Object, uid string) error
UID(obj runtime.Object) (util.UID, error)
SetUID(obj runtime.Object, uid util.UID) error
SelfLink(obj runtime.Object) (string, error)
SetSelfLink(obj runtime.Object, selfLink string) error