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

Side by Side Diff: impl/dummy/dummy.go

Issue 1253263002: Make rawdatastore API safer for writing filters. (Closed) Base URL: https://github.com/luci/gae.git@master
Patch Set: fix comments 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
« no previous file with comments | « filter/featureBreaker/rds.go ('k') | impl/dummy/dummy_test.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 dummy 5 package dummy
6 6
7 import ( 7 import (
8 "fmt" 8 "fmt"
9 "runtime" 9 "runtime"
10 "strings" 10 "strings"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 } 57 }
58 } 58 }
59 59
60 return fmt.Errorf(niFmtStr, iface, funcName) 60 return fmt.Errorf(niFmtStr, iface, funcName)
61 } 61 }
62 62
63 /////////////////////////////////// rds //////////////////////////////////// 63 /////////////////////////////////// rds ////////////////////////////////////
64 64
65 type rds struct{} 65 type rds struct{}
66 66
67 func (rds) NewKey(string, string, int64, rawdatastore.Key) rawdatastore.Key { panic(ni()) } 67 func (rds) NewKey(kind string, sid string, iid int64, par rawdatastore.Key) rawd atastore.Key {
68 func (rds) DecodeKey(string) (rawdatastore.Key, error) { panic(ni()) } 68 » return rawdatastore.NewKey("dummy~appid", "", kind, sid, iid, par)
69 func (rds) KeyFromTokens(a, n string, t []rawdatastore.KeyTok) (rawdatastore.Key , error) { panic(ni()) } 69 }
70 func (rds) Put(rawdatastore.Key, rawdatastore.PropertyLoadSaver) (rawdatastore.K ey, error) { 70 func (rds) DecodeKey(string) (rawdatastore.Key, error) { panic(ni()) }
71 func (rds) PutMulti([]rawdatastore.Key, []rawdatastore.PropertyLoadSaver, rawdat astore.PutMultiCB) error {
71 panic(ni()) 72 panic(ni())
72 } 73 }
73 func (rds) Get(rawdatastore.Key, rawdatastore.PropertyLoadSaver) error { panic(n i()) } 74 func (rds) GetMulti([]rawdatastore.Key, rawdatastore.GetMultiCB) error { p anic(ni()) }
74 func (rds) Delete(rawdatastore.Key) error { panic(n i()) } 75 func (rds) DeleteMulti([]rawdatastore.Key, rawdatastore.DeleteMultiCB) error { p anic(ni()) }
75 func (rds) PutMulti([]rawdatastore.Key, []rawdatastore.PropertyLoadSaver) ([]raw datastore.Key, error) { 76 func (rds) NewQuery(string) rawdatastore.Query { p anic(ni()) }
76 » panic(ni()) 77 func (rds) Run(rawdatastore.Query, rawdatastore.RunCB) error { p anic(ni()) }
77 }
78 func (rds) GetMulti([]rawdatastore.Key, []rawdatastore.PropertyLoadSaver) error { panic(ni()) }
79 func (rds) DeleteMulti([]rawdatastore.Key) error { panic(ni()) }
80 func (rds) NewQuery(string) rawdatastore.Query { panic(ni()) }
81 func (rds) Run(rawdatastore.Query) rawdatastore.Iterator { panic(ni()) }
82 func (rds) GetAll(rawdatastore.Query, *[]rawdatastore.PropertyMap) ([]rawdatasto re.Key, error) {
83 » panic(ni())
84 }
85 func (rds) Count(rawdatastore.Query) (int, error) { panic(ni()) }
86 func (rds) RunInTransaction(func(context.Context) error, *rawdatastore.Transacti onOptions) error { 78 func (rds) RunInTransaction(func(context.Context) error, *rawdatastore.Transacti onOptions) error {
87 panic(ni()) 79 panic(ni())
88 } 80 }
89 81
90 var dummyRDSInst = rds{} 82 var dummyRDSInst = rds{}
91 83
92 // RawDatastore returns a dummy rawdatastore.Interface implementation suitable 84 // RawDatastore returns a dummy rawdatastore.Interface implementation suitable
93 // 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
94 // method which was unimplemented. 86 // method which was unimplemented.
95 func RawDatastore() rawdatastore.Interface { return dummyRDSInst } 87 func RawDatastore() rawdatastore.Interface { return dummyRDSInst }
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 // TaskQueue returns a dummy taskqueue.Interface implementation suitable for 132 // TaskQueue returns a dummy taskqueue.Interface implementation suitable for
141 // embedding. Every method panics with a message containing the name of the 133 // embedding. Every method panics with a message containing the name of the
142 // method which was unimplemented. 134 // method which was unimplemented.
143 func TaskQueue() taskqueue.Interface { return dummyTQInst } 135 func TaskQueue() taskqueue.Interface { return dummyTQInst }
144 136
145 /////////////////////////////////// i //////////////////////////////////// 137 /////////////////////////////////// i ////////////////////////////////////
146 138
147 type i struct{} 139 type i struct{}
148 140
149 func (i) AccessToken(scopes ...string) (token string, expiry time.Time, err erro r) { panic(ni()) } 141 func (i) AccessToken(scopes ...string) (token string, expiry time.Time, err erro r) { panic(ni()) }
150 func (i) AppID() string { panic(ni()) } 142 func (i) AppID() string { return "dummy~appid" }
143 func (i) GetNamespace() string { return "dummy-namespace" }
151 func (i) ModuleHostname(module, version, instance string) (string, error) { panic(ni()) } 144 func (i) ModuleHostname(module, version, instance string) (string, error) { panic(ni()) }
152 func (i) ModuleName() string { panic(ni()) } 145 func (i) ModuleName() string { panic(ni()) }
153 func (i) DefaultVersionHostname() string { panic(ni()) } 146 func (i) DefaultVersionHostname() string { panic(ni()) }
154 func (i) PublicCertificates() ([]info.Certificate, error) { panic(ni()) } 147 func (i) PublicCertificates() ([]info.Certificate, error) { panic(ni()) }
155 func (i) RequestID() string { panic(ni()) } 148 func (i) RequestID() string { panic(ni()) }
156 func (i) ServiceAccount() (string, error) { panic(ni()) } 149 func (i) ServiceAccount() (string, error) { panic(ni()) }
157 func (i) SignBytes(bytes []byte) (keyName string, signature []byte, err error) { panic(ni()) } 150 func (i) SignBytes(bytes []byte) (keyName string, signature []byte, err error) { panic(ni()) }
158 func (i) VersionID() string { panic(ni()) } 151 func (i) VersionID() string { panic(ni()) }
159 func (i) Namespace(namespace string) (context.Context, error) { panic(ni()) } 152 func (i) Namespace(namespace string) (context.Context, error) { panic(ni()) }
160 func (i) Datacenter() string { panic(ni()) } 153 func (i) Datacenter() string { panic(ni()) }
161 func (i) InstanceID() string { panic(ni()) } 154 func (i) InstanceID() string { panic(ni()) }
162 func (i) IsDevAppServer() bool { panic(ni()) } 155 func (i) IsDevAppServer() bool { panic(ni()) }
163 func (i) ServerSoftware() string { panic(ni()) } 156 func (i) ServerSoftware() string { panic(ni()) }
164 func (i) IsCapabilityDisabled(err error) bool { panic(ni()) } 157 func (i) IsCapabilityDisabled(err error) bool { panic(ni()) }
165 func (i) IsOverQuota(err error) bool { panic(ni()) } 158 func (i) IsOverQuota(err error) bool { panic(ni()) }
166 func (i) IsTimeoutError(err error) bool { panic(ni()) } 159 func (i) IsTimeoutError(err error) bool { panic(ni()) }
167 160
168 var dummyInfoInst = i{} 161 var dummyInfoInst = i{}
169 162
170 // Info returns a dummy info.Interface implementation suitable for embedding. 163 // Info returns a dummy info.Interface implementation suitable for embedding.
171 // 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
172 // was unimplemented. 165 // was unimplemented.
173 func Info() info.Interface { return dummyInfoInst } 166 func Info() info.Interface { return dummyInfoInst }
OLDNEW
« no previous file with comments | « filter/featureBreaker/rds.go ('k') | impl/dummy/dummy_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698