| 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 dummy | 5 package dummy |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "fmt" | 8 "fmt" |
| 9 "runtime" | 9 "runtime" |
| 10 "strings" | 10 "strings" |
| 11 "time" | 11 "time" |
| 12 | 12 |
| 13 "github.com/luci/gae/service/datastore" | 13 "github.com/luci/gae/service/datastore" |
| 14 "github.com/luci/gae/service/datastore/dskey" |
| 14 "github.com/luci/gae/service/info" | 15 "github.com/luci/gae/service/info" |
| 15 "github.com/luci/gae/service/memcache" | 16 "github.com/luci/gae/service/memcache" |
| 16 "github.com/luci/gae/service/taskqueue" | 17 "github.com/luci/gae/service/taskqueue" |
| 17 "golang.org/x/net/context" | 18 "golang.org/x/net/context" |
| 18 ) | 19 ) |
| 19 | 20 |
| 20 const niFmtStr = "dummy: method %s.%s is not implemented" | 21 const niFmtStr = "dummy: method %s.%s is not implemented" |
| 21 | 22 |
| 22 // ni returns an error whose message is an appropriate expansion of niFmtStr. | 23 // ni returns an error whose message is an appropriate expansion of niFmtStr. |
| 23 // | 24 // |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 } | 59 } |
| 59 | 60 |
| 60 return fmt.Errorf(niFmtStr, iface, funcName) | 61 return fmt.Errorf(niFmtStr, iface, funcName) |
| 61 } | 62 } |
| 62 | 63 |
| 63 /////////////////////////////////// ds //////////////////////////////////// | 64 /////////////////////////////////// ds //////////////////////////////////// |
| 64 | 65 |
| 65 type ds struct{} | 66 type ds struct{} |
| 66 | 67 |
| 67 func (ds) NewKey(kind string, sid string, iid int64, par datastore.Key) datastor
e.Key { | 68 func (ds) NewKey(kind string, sid string, iid int64, par datastore.Key) datastor
e.Key { |
| 68 » return datastore.NewKey("dummy~appid", "", kind, sid, iid, par) | 69 » return dskey.New("dummy~appid", "", kind, sid, iid, par) |
| 69 } | 70 } |
| 70 func (ds) DecodeKey(string) (datastore.Key, error) { panic(ni()) } | 71 func (ds) DecodeKey(string) (datastore.Key, error) { panic(ni()) } |
| 71 func (ds) PutMulti([]datastore.Key, []datastore.PropertyMap, datastore.PutMultiC
B) error { | 72 func (ds) PutMulti([]datastore.Key, []datastore.PropertyMap, datastore.PutMultiC
B) error { |
| 72 panic(ni()) | 73 panic(ni()) |
| 73 } | 74 } |
| 74 func (ds) GetMulti([]datastore.Key, datastore.MultiMetaGetter, datastore.GetMult
iCB) error { | 75 func (ds) GetMulti([]datastore.Key, datastore.MultiMetaGetter, datastore.GetMult
iCB) error { |
| 75 panic(ni()) | 76 panic(ni()) |
| 76 } | 77 } |
| 77 func (ds) DeleteMulti([]datastore.Key, datastore.DeleteMultiCB) error { panic(ni
()) } | 78 func (ds) DeleteMulti([]datastore.Key, datastore.DeleteMultiCB) error { panic(ni
()) } |
| 78 func (ds) NewQuery(string) datastore.Query { panic(ni
()) } | 79 func (ds) NewQuery(string) datastore.Query { panic(ni
()) } |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 func (i) IsCapabilityDisabled(err error) bool
{ panic(ni()) } | 151 func (i) IsCapabilityDisabled(err error) bool
{ panic(ni()) } |
| 151 func (i) IsOverQuota(err error) bool
{ panic(ni()) } | 152 func (i) IsOverQuota(err error) bool
{ panic(ni()) } |
| 152 func (i) IsTimeoutError(err error) bool
{ panic(ni()) } | 153 func (i) IsTimeoutError(err error) bool
{ panic(ni()) } |
| 153 | 154 |
| 154 var dummyInfoInst = i{} | 155 var dummyInfoInst = i{} |
| 155 | 156 |
| 156 // Info returns a dummy info.Interface implementation suitable for embedding. | 157 // Info returns a dummy info.Interface implementation suitable for embedding. |
| 157 // Every method panics with a message containing the name of the method which | 158 // Every method panics with a message containing the name of the method which |
| 158 // was unimplemented. | 159 // was unimplemented. |
| 159 func Info() info.Interface { return dummyInfoInst } | 160 func Info() info.Interface { return dummyInfoInst } |
| OLD | NEW |