| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The LUCI 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 under the Apache License, Version 2.0 |
| 3 // found in the LICENSE file. | 3 // that can be 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. Item | 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 // is guaranteed to be nil if error is not nil. |
| 13 type RawItemCB func(Item, error) | 13 type RawItemCB func(Item, error) |
| 14 | 14 |
| 15 // RawInterface is the full interface to the memcache service. | 15 // RawInterface is the full interface to the memcache service. |
| 16 type RawInterface interface { | 16 type RawInterface interface { |
| 17 NewItem(key string) Item | 17 NewItem(key string) Item |
| 18 | 18 |
| 19 AddMulti(items []Item, cb RawCB) error | 19 AddMulti(items []Item, cb RawCB) error |
| 20 SetMulti(items []Item, cb RawCB) error | 20 SetMulti(items []Item, cb RawCB) error |
| 21 GetMulti(keys []string, cb RawItemCB) error | 21 GetMulti(keys []string, cb RawItemCB) error |
| 22 DeleteMulti(keys []string, cb RawCB) error | 22 DeleteMulti(keys []string, cb RawCB) error |
| 23 CompareAndSwapMulti(items []Item, cb RawCB) error | 23 CompareAndSwapMulti(items []Item, cb RawCB) error |
| 24 | 24 |
| 25 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) |
| 26 | 26 |
| 27 Flush() error | 27 Flush() error |
| 28 | 28 |
| 29 Stats() (*Statistics, error) | 29 Stats() (*Statistics, error) |
| 30 } | 30 } |
| OLD | NEW |