Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(239)

Unified Diff: service/memcache/interface.go

Issue 1354333002: Fix memcache.Interface.Get to return a memcache.Item (Closed) Base URL: https://github.com/luci/gae.git@fix_meta_serialize
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: service/memcache/interface.go
diff --git a/service/memcache/interface.go b/service/memcache/interface.go
index 0c043b6aac42669e590b0edd446c60742e4e4ae7..afb800a48a07923e704cb02f1e0a28824bed10f5 100644
--- a/service/memcache/interface.go
+++ b/service/memcache/interface.go
@@ -21,9 +21,11 @@ type Interface interface {
// Set the item in memcache, whether or not it exists.
Set(item Item) error
- // Get retrieves an item from memcache. Only the key field is read. The item
- // will be mutated to contain the data in the memcache item.
- Get(item Item) error
+ // Get retrieves an item from memcache.
+ //
+ // On a cache miss ErrCacheMiss will be returned. Item will always be
+ // returned, even on a miss, but it's value may be empty if it was a miss.
+ Get(key string) (Item, error)
// Delete removes an item from memcache.
Delete(key string) error
@@ -41,6 +43,8 @@ type Interface interface {
// mc.CompareAndSwap(itm) // check error
CompareAndSwap(item Item) error
+ // Batch operations; GetMulti takes a []Item instead of []string to improve
+ // ergonomics when streamlining these operations.
AddMulti(items []Item) error
SetMulti(items []Item) error
GetMulti(items []Item) error

Powered by Google App Engine
This is Rietveld 408576698