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

Unified Diff: impl/dummy/dummy.go

Issue 1772943003: Add wrappers for the module module (Closed) Base URL: https://github.com/luci/gae.git@master
Patch Set: CL comments Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « impl/dummy/doc.go ('k') | impl/dummy/dummy_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: impl/dummy/dummy.go
diff --git a/impl/dummy/dummy.go b/impl/dummy/dummy.go
index 649a6b5f358777f79a9372e4444f3a9ec37ed312..01c192f06c31d8418a236c6bed8686511c028440 100644
--- a/impl/dummy/dummy.go
+++ b/impl/dummy/dummy.go
@@ -14,6 +14,7 @@ import (
"github.com/luci/gae/service/info"
"github.com/luci/gae/service/mail"
"github.com/luci/gae/service/memcache"
+ "github.com/luci/gae/service/module"
"github.com/luci/gae/service/taskqueue"
"github.com/luci/gae/service/user"
"golang.org/x/net/context"
@@ -53,6 +54,8 @@ func ni() error {
iface = "Mail"
case "mc":
iface = "Memcache"
+ case "mod":
+ iface = "Module"
case "tq":
iface = "TaskQueue"
case "u":
@@ -201,3 +204,22 @@ var dummyMailInst = m{}
// Every method panics with a message containing the name of the method which
// was unimplemented.
func Mail() mail.Interface { return dummyMailInst }
+
+/////////////////////////////////// mod ////////////////////////////////////
+
+type mod struct{}
+
+func (mod) List() ([]string, error) { panic(ni()) }
+func (mod) NumInstances(module, version string) (int, error) { panic(ni()) }
+func (mod) SetNumInstances(module, version string, instances int) error { panic(ni()) }
+func (mod) Versions(module string) ([]string, error) { panic(ni()) }
+func (mod) DefaultVersion(module string) (string, error) { panic(ni()) }
+func (mod) Start(module, version string) error { panic(ni()) }
+func (mod) Stop(module, version string) error { panic(ni()) }
+
+var dummyModuleInst = mod{}
+
+// Module returns a dummy module.Interface implementation suitable for
+// embedding. Every method panics with a message containing the name of the
+// method which was unimplemented.
+func Module() module.Interface { return dummyModuleInst }
« no previous file with comments | « impl/dummy/doc.go ('k') | impl/dummy/dummy_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698