OLD | NEW |
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 } |
OLD | NEW |