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

Side by Side Diff: service/memcache/raw_interface.go

Issue 1269113005: A transparent cache for datastore, backed by memcache. (Closed) Base URL: https://github.com/luci/gae.git@add_meta
Patch Set: add test for per-model expiration Created 5 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package memcache 5 package memcache
6 6
7 // RawCB is a simple error callback for most of the methods in RawInterface. 7 // RawCB is a simple error callback for most of the methods in RawInterface.
8 type RawCB func(error) 8 type RawCB func(error)
9 9
10 // RawItemCB is the callback for RawInterface.GetMulti. It takes the retrieved 10 // RawItemCB is the callback for RawInterface.GetMulti. It takes the retrieved
11 // item and the error for that item (e.g. ErrCacheMiss) if there was one.. 11 // item and the error for that item (e.g. ErrCacheMiss) if there was one. Item
12 // is guaranteed to be nil if error is not nil.
12 type RawItemCB func(Item, error) 13 type RawItemCB func(Item, error)
13 14
14 // RawInterface is the full interface to the memcache service. 15 // RawInterface is the full interface to the memcache service.
15 type RawInterface interface { 16 type RawInterface interface {
16 NewItem(key string) Item 17 NewItem(key string) Item
17 18
18 AddMulti(items []Item, cb RawCB) error 19 AddMulti(items []Item, cb RawCB) error
19 SetMulti(items []Item, cb RawCB) error 20 SetMulti(items []Item, cb RawCB) error
20 GetMulti(keys []string, cb RawItemCB) error 21 GetMulti(keys []string, cb RawItemCB) error
21 DeleteMulti(keys []string, cb RawCB) error 22 DeleteMulti(keys []string, cb RawCB) error
22 CompareAndSwapMulti(items []Item, cb RawCB) error 23 CompareAndSwapMulti(items []Item, cb RawCB) error
23 24
24 Increment(key string, delta int64, initialValue *uint64) (newValue uint6 4, err error) 25 Increment(key string, delta int64, initialValue *uint64) (newValue uint6 4, err error)
25 26
26 Flush() error 27 Flush() error
27 28
28 Stats() (*Statistics, error) 29 Stats() (*Statistics, error)
29 } 30 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698