| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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.RawRunCB) 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.RawInterface 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.RawInterface { 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) NewItem(key string) memcache.Item { panic(ni(
)) } |
| 94 func (mc) NewItem(key string) memcache.Item { panic(ni()) } | 94 func (mc) AddMulti([]memcache.Item, memcache.RawCB) error { panic(ni(
)) } |
| 95 func (mc) Set(memcache.Item) error { panic(ni()) } | 95 func (mc) SetMulti([]memcache.Item, memcache.RawCB) error { panic(ni(
)) } |
| 96 func (mc) Get(string) (memcache.Item, error) { panic(ni()) } | 96 func (mc) GetMulti([]string, memcache.RawItemCB) error { panic(ni(
)) } |
| 97 func (mc) Delete(string) error { panic(ni()) } | 97 func (mc) DeleteMulti([]string, memcache.RawCB) error { panic(ni(
)) } |
| 98 func (mc) CompareAndSwap(memcache.Item) error { panic(ni()) } | 98 func (mc) CompareAndSwapMulti([]memcache.Item, memcache.RawCB) error { panic(ni(
)) } |
| 99 func (mc) AddMulti([]memcache.Item) error { panic(ni()) } | 99 func (mc) Increment(string, int64, *uint64) (uint64, error) { panic(ni(
)) } |
| 100 func (mc) SetMulti([]memcache.Item) error { panic(ni()) } | 100 func (mc) Flush() error { panic(ni(
)) } |
| 101 func (mc) GetMulti([]string) (map[string]memcache.Item, error) { panic(ni()) } | 101 func (mc) Stats() (*memcache.Statistics, error) { panic(ni(
)) } |
| 102 func (mc) DeleteMulti([]string) error { panic(ni()) } | |
| 103 func (mc) CompareAndSwapMulti([]memcache.Item) error { panic(ni()) } | |
| 104 func (mc) Increment(string, int64, uint64) (uint64, error) { panic(ni()) } | |
| 105 func (mc) IncrementExisting(string, int64) (uint64, error) { panic(ni()) } | |
| 106 func (mc) Flush() error { panic(ni()) } | |
| 107 func (mc) Stats() (*memcache.Statistics, error) { panic(ni()) } | |
| 108 | 102 |
| 109 var dummyMCInst = mc{} | 103 var dummyMCInst = mc{} |
| 110 | 104 |
| 111 // Memcache returns a dummy memcache.Interface implementation suitable for | 105 // Memcache returns a dummy memcache.RawInterface implementation suitable for |
| 112 // embedding. Every method panics with a message containing the name of the | 106 // embedding. Every method panics with a message containing the name of the |
| 113 // method which was unimplemented. | 107 // method which was unimplemented. |
| 114 func Memcache() memcache.Interface { return dummyMCInst } | 108 func Memcache() memcache.RawInterface { return dummyMCInst } |
| 115 | 109 |
| 116 /////////////////////////////////// tq //////////////////////////////////// | 110 /////////////////////////////////// tq //////////////////////////////////// |
| 117 | 111 |
| 118 type tq struct{} | 112 type tq struct{} |
| 119 | 113 |
| 120 func (tq) Add(*taskqueue.Task, string) (*taskqueue.Task, error) { pani
c(ni()) } | 114 func (tq) AddMulti([]*taskqueue.Task, string, taskqueue.RawTaskCB) error { panic
(ni()) } |
| 121 func (tq) Delete(*taskqueue.Task, string) error { pani
c(ni()) } | 115 func (tq) DeleteMulti([]*taskqueue.Task, string, taskqueue.RawCB) error { panic
(ni()) } |
| 122 func (tq) AddMulti([]*taskqueue.Task, string) ([]*taskqueue.Task, error) { pani
c(ni()) } | 116 func (tq) Purge(string) error { panic
(ni()) } |
| 123 func (tq) DeleteMulti([]*taskqueue.Task, string) error { pani
c(ni()) } | 117 func (tq) Stats([]string, taskqueue.RawStatsCB) error { panic
(ni()) } |
| 124 func (tq) Lease(int, string, int) ([]*taskqueue.Task, error) { pani
c(ni()) } | |
| 125 func (tq) LeaseByTag(int, string, int, string) ([]*taskqueue.Task, error) { pani
c(ni()) } | |
| 126 func (tq) ModifyLease(*taskqueue.Task, string, int) error { pani
c(ni()) } | |
| 127 func (tq) Purge(string) error { pani
c(ni()) } | |
| 128 func (tq) QueueStats([]string) ([]taskqueue.Statistics, error) { pani
c(ni()) } | |
| 129 | 118 |
| 130 var dummyTQInst = tq{} | 119 var dummyTQInst = tq{} |
| 131 | 120 |
| 132 // TaskQueue returns a dummy taskqueue.Interface implementation suitable for | 121 // TaskQueue returns a dummy taskqueue.RawInterface implementation suitable for |
| 133 // embedding. Every method panics with a message containing the name of the | 122 // embedding. Every method panics with a message containing the name of the |
| 134 // method which was unimplemented. | 123 // method which was unimplemented. |
| 135 func TaskQueue() taskqueue.Interface { return dummyTQInst } | 124 func TaskQueue() taskqueue.RawInterface { return dummyTQInst } |
| 136 | 125 |
| 137 /////////////////////////////////// i //////////////////////////////////// | 126 /////////////////////////////////// i //////////////////////////////////// |
| 138 | 127 |
| 139 type i struct{} | 128 type i struct{} |
| 140 | 129 |
| 141 func (i) AccessToken(scopes ...string) (token string, expiry time.Time, err erro
r) { panic(ni()) } | 130 func (i) AccessToken(scopes ...string) (token string, expiry time.Time, err erro
r) { panic(ni()) } |
| 142 func (i) AppID() string
{ return "dummy~appid" } | 131 func (i) AppID() string
{ return "dummy~appid" } |
| 143 func (i) GetNamespace() string
{ return "dummy-namespace" } | 132 func (i) GetNamespace() string
{ return "dummy-namespace" } |
| 144 func (i) ModuleHostname(module, version, instance string) (string, error)
{ panic(ni()) } | 133 func (i) ModuleHostname(module, version, instance string) (string, error)
{ panic(ni()) } |
| 145 func (i) ModuleName() string
{ panic(ni()) } | 134 func (i) ModuleName() string
{ panic(ni()) } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 157 func (i) IsCapabilityDisabled(err error) bool
{ panic(ni()) } | 146 func (i) IsCapabilityDisabled(err error) bool
{ panic(ni()) } |
| 158 func (i) IsOverQuota(err error) bool
{ panic(ni()) } | 147 func (i) IsOverQuota(err error) bool
{ panic(ni()) } |
| 159 func (i) IsTimeoutError(err error) bool
{ panic(ni()) } | 148 func (i) IsTimeoutError(err error) bool
{ panic(ni()) } |
| 160 | 149 |
| 161 var dummyInfoInst = i{} | 150 var dummyInfoInst = i{} |
| 162 | 151 |
| 163 // Info returns a dummy info.Interface implementation suitable for embedding. | 152 // Info returns a dummy info.Interface implementation suitable for embedding. |
| 164 // Every method panics with a message containing the name of the method which | 153 // Every method panics with a message containing the name of the method which |
| 165 // was unimplemented. | 154 // was unimplemented. |
| 166 func Info() info.Interface { return dummyInfoInst } | 155 func Info() info.Interface { return dummyInfoInst } |
| OLD | NEW |