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

Side by Side Diff: service/datastore/datastore.go

Issue 1302813003: impl/memory: Implement Queries (Closed) Base URL: https://github.com/luci/gae.git@add_multi_iterator
Patch Set: stringSet everywhere 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 unified diff | Download patch
« no previous file with comments | « impl/memory/testing_utils_test.go ('k') | service/datastore/index.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 datastore 5 package datastore
6 6
7 import ( 7 import (
8 "fmt" 8 "fmt"
9 "reflect" 9 "reflect"
10 10
(...skipping 14 matching lines...) Expand all
25 25
26 func (d *datastoreImpl) KeyForObjErr(src interface{}) (Key, error) { 26 func (d *datastoreImpl) KeyForObjErr(src interface{}) (Key, error) {
27 return newKeyObjErr(d.NewKey, src) 27 return newKeyObjErr(d.NewKey, src)
28 } 28 }
29 29
30 func (d *datastoreImpl) DecodeCursor(s string) (Cursor, error) { 30 func (d *datastoreImpl) DecodeCursor(s string) (Cursor, error) {
31 return d.RawInterface.DecodeCursor(s) 31 return d.RawInterface.DecodeCursor(s)
32 } 32 }
33 33
34 func (d *datastoreImpl) Run(q Query, cbIface interface{}) error { 34 func (d *datastoreImpl) Run(q Query, cbIface interface{}) error {
35 if cbIface == nil {
36 return fmt.Errorf("cannot use nil callback when Running query")
37 }
38
35 // TODO(riannucci): Profile and determine if any of this is causing a re al 39 // TODO(riannucci): Profile and determine if any of this is causing a re al
36 // slowdown. Could potentially cache reflection stuff by cbType? 40 // slowdown. Could potentially cache reflection stuff by cbType?
37 cbTyp := reflect.TypeOf(cbIface) 41 cbTyp := reflect.TypeOf(cbIface)
38 42
39 badSig := false 43 badSig := false
40 mat := multiArgType{} 44 mat := multiArgType{}
41 isKey := false 45 isKey := false
42 46
43 if cbTyp.Kind() == reflect.Func && cbTyp.NumIn() == 2 && cbTyp.NumOut() == 1 { 47 if cbTyp.Kind() == reflect.Func && cbTyp.NumIn() == 2 && cbTyp.NumOut() == 1 {
44 firstArg := cbTyp.In(0) 48 firstArg := cbTyp.In(0)
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 err = lme.Get() 218 err = lme.Get()
215 if err == nil { 219 if err == nil {
216 err = extErr 220 err = extErr
217 } 221 }
218 return 222 return
219 } 223 }
220 224
221 func (d *datastoreImpl) Raw() RawInterface { 225 func (d *datastoreImpl) Raw() RawInterface {
222 return d.RawInterface 226 return d.RawInterface
223 } 227 }
OLDNEW
« no previous file with comments | « impl/memory/testing_utils_test.go ('k') | service/datastore/index.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698