| 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" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 } | 61 } |
| 62 | 62 |
| 63 /////////////////////////////////// ds //////////////////////////////////// | 63 /////////////////////////////////// ds //////////////////////////////////// |
| 64 | 64 |
| 65 type ds struct{} | 65 type ds struct{} |
| 66 | 66 |
| 67 func (ds) NewKey(kind string, sid string, iid int64, par datastore.Key) datastor
e.Key { | 67 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) | 68 return datastore.NewKey("dummy~appid", "", kind, sid, iid, par) |
| 69 } | 69 } |
| 70 func (ds) DecodeKey(string) (datastore.Key, error) { panic(ni()) } | 70 func (ds) DecodeKey(string) (datastore.Key, error) { panic(ni()) } |
| 71 func (ds) PutMulti([]datastore.Key, []datastore.PropertyLoadSaver, datastore.Put
MultiCB) error { | 71 func (ds) PutMulti([]datastore.Key, []datastore.PropertyMap, datastore.PutMultiC
B) error { |
| 72 panic(ni()) | 72 panic(ni()) |
| 73 } | 73 } |
| 74 func (ds) GetMulti([]datastore.Key, datastore.GetMultiCB) error { panic(ni
()) } | 74 func (ds) GetMulti([]datastore.Key, datastore.GetMultiCB) error { panic(ni
()) } |
| 75 func (ds) DeleteMulti([]datastore.Key, datastore.DeleteMultiCB) error { panic(ni
()) } | 75 func (ds) DeleteMulti([]datastore.Key, datastore.DeleteMultiCB) error { panic(ni
()) } |
| 76 func (ds) NewQuery(string) datastore.Query { panic(ni
()) } | 76 func (ds) NewQuery(string) datastore.Query { panic(ni
()) } |
| 77 func (ds) Run(datastore.Query, datastore.RunCB) error { panic(ni
()) } | 77 func (ds) Run(datastore.Query, datastore.RawRunCB) error { panic(ni
()) } |
| 78 func (ds) RunInTransaction(func(context.Context) error, *datastore.TransactionOp
tions) error { | 78 func (ds) RunInTransaction(func(context.Context) error, *datastore.TransactionOp
tions) error { |
| 79 panic(ni()) | 79 panic(ni()) |
| 80 } | 80 } |
| 81 | 81 |
| 82 var dummyDSInst = ds{} | 82 var dummyDSInst = ds{} |
| 83 | 83 |
| 84 // Datastore returns a dummy datastore.Interface implementation suitable | 84 // Datastore returns a dummy datastore.Interface implementation suitable |
| 85 // for embedding. Every method panics with a message containing the name of the | 85 // for embedding. Every method panics with a message containing the name of the |
| 86 // method which was unimplemented. | 86 // method which was unimplemented. |
| 87 func Datastore() datastore.Interface { return dummyDSInst } | 87 func Datastore() datastore.RawInterface { return dummyDSInst } |
| 88 | 88 |
| 89 /////////////////////////////////// mc //////////////////////////////////// | 89 /////////////////////////////////// mc //////////////////////////////////// |
| 90 | 90 |
| 91 type mc struct{} | 91 type mc struct{} |
| 92 | 92 |
| 93 func (mc) Add(memcache.Item) error { panic(ni()) } | 93 func (mc) Add(memcache.Item) error { panic(ni()) } |
| 94 func (mc) NewItem(key string) memcache.Item { panic(ni()) } | 94 func (mc) NewItem(key string) memcache.Item { panic(ni()) } |
| 95 func (mc) Set(memcache.Item) error { panic(ni()) } | 95 func (mc) Set(memcache.Item) error { panic(ni()) } |
| 96 func (mc) Get(string) (memcache.Item, error) { panic(ni()) } | 96 func (mc) Get(string) (memcache.Item, error) { panic(ni()) } |
| 97 func (mc) Delete(string) error { panic(ni()) } | 97 func (mc) Delete(string) error { panic(ni()) } |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 func (i) IsCapabilityDisabled(err error) bool
{ panic(ni()) } | 157 func (i) IsCapabilityDisabled(err error) bool
{ panic(ni()) } |
| 158 func (i) IsOverQuota(err error) bool
{ panic(ni()) } | 158 func (i) IsOverQuota(err error) bool
{ panic(ni()) } |
| 159 func (i) IsTimeoutError(err error) bool
{ panic(ni()) } | 159 func (i) IsTimeoutError(err error) bool
{ panic(ni()) } |
| 160 | 160 |
| 161 var dummyInfoInst = i{} | 161 var dummyInfoInst = i{} |
| 162 | 162 |
| 163 // Info returns a dummy info.Interface implementation suitable for embedding. | 163 // Info returns a dummy info.Interface implementation suitable for embedding. |
| 164 // Every method panics with a message containing the name of the method which | 164 // Every method panics with a message containing the name of the method which |
| 165 // was unimplemented. | 165 // was unimplemented. |
| 166 func Info() info.Interface { return dummyInfoInst } | 166 func Info() info.Interface { return dummyInfoInst } |
| OLD | NEW |