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

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

Issue 1270063003: Make the rest of the services have a similar raw/user interface structure. (Closed) Base URL: https://github.com/luci/gae.git@add_datastore
Patch Set: 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 import ( 7 import (
8 "time" 8 "time"
9 ) 9 )
10 10
(...skipping 10 matching lines...) Expand all
21 21
22 Oldest int64 // Age of access of the oldest item, in seconds 22 Oldest int64 // Age of access of the oldest item, in seconds
23 } 23 }
24 24
25 // Item is a wrapper around *memcache.Item. Note that the Set* methods all 25 // Item is a wrapper around *memcache.Item. Note that the Set* methods all
26 // return the original Item (e.g. they mutate the original), due to 26 // return the original Item (e.g. they mutate the original), due to
27 // implementation constraints. They return the original item to allow easy 27 // implementation constraints. They return the original item to allow easy
28 // chaining, e.g.: 28 // chaining, e.g.:
29 // itm := memcache.Get(c).NewItem("foo").SetValue([]byte("stuff")) 29 // itm := memcache.Get(c).NewItem("foo").SetValue([]byte("stuff"))
30 type Item interface { 30 type Item interface {
31 Key() string 31 Key() string
dnj 2015/08/03 22:37:25 Exported methods need comments.
32 Value() []byte 32 Value() []byte
33 Object() interface{}
34 Flags() uint32 33 Flags() uint32
35 Expiration() time.Duration 34 Expiration() time.Duration
36 35
37 SetKey(string) Item 36 SetKey(string) Item
38 SetValue([]byte) Item 37 SetValue([]byte) Item
39 SetObject(interface{}) Item
40 SetFlags(uint32) Item 38 SetFlags(uint32) Item
41 SetExpiration(time.Duration) Item 39 SetExpiration(time.Duration) Item
40
41 SetAll(other Item)
42 } 42 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698