Skip to content

Commit

Permalink
expose codec in storage
Browse files Browse the repository at this point in the history
  • Loading branch information
pweil- committed Aug 5, 2015
1 parent ded48a3 commit 2a61b55
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions pkg/storage/etcd/etcd_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ func init() {
metrics.Register()
}

// Codec provides access to the underlying codec being used by the implementation.
func (h *etcdHelper) Codec() runtime.Codec {
return h.codec
}

// Implements storage.Interface.
func (h *etcdHelper) Backends() []string {
return h.client.GetCluster()
Expand Down
5 changes: 4 additions & 1 deletion pkg/storage/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func Everything(runtime.Object) bool {
type UpdateFunc func(input runtime.Object, res ResponseMeta) (output runtime.Object, ttl *uint64, err error)

// Interface offers a common interface for object marshaling/unmarshling operations and
// hids all the storage-related operations behind it.
// hides all the storage-related operations behind it.
type Interface interface {
// Returns list of servers addresses of the underyling database.
// TODO: This method is used only in a single place. Consider refactoring and getting rid
Expand Down Expand Up @@ -146,4 +146,7 @@ type Interface interface {
// }
// })
GuaranteedUpdate(key string, ptrToType runtime.Object, ignoreNotFound bool, tryUpdate UpdateFunc) error

// Codec provides access to the underlying codec being used by the implementation.
Codec() runtime.Codec
}

0 comments on commit 2a61b55

Please sign in to comment.