Index: impl/dummy/dummy.go |
diff --git a/impl/dummy/dummy.go b/impl/dummy/dummy.go |
index 3705ab4a3a676c4c80009bcec8faa92d541fe1d8..5134c62fcf6f9cb7b4b73945537cf5ec9ed31c33 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/memcache" |
"github.com/luci/gae/service/taskqueue" |
+ "github.com/luci/gae/service/user" |
"golang.org/x/net/context" |
) |
@@ -45,12 +46,14 @@ func ni() error { |
switch parts[len(parts)-2] { |
case "ds": |
iface = "Datastore" |
+ case "i": |
+ iface = "Info" |
case "mc": |
iface = "Memcache" |
case "tq": |
iface = "TaskQueue" |
- case "i": |
- iface = "Info" |
+ case "u": |
+ iface = "User" |
} |
funcName = parts[len(parts)-1] |
} |
@@ -159,3 +162,22 @@ var dummyInfoInst = i{} |
// Every method panics with a message containing the name of the method which |
// was unimplemented. |
func Info() info.Interface { return dummyInfoInst } |
+ |
+////////////////////////////////////// u /////////////////////////////////////// |
+ |
+type u struct{} |
+ |
+func (u) Current() *user.User { panic(ni()) } |
+func (u) CurrentOAuth() (*user.User, error) { panic(ni()) } |
+func (u) IsAdmin() bool { panic(ni()) } |
+func (u) LoginURL(string) (string, error) { panic(ni()) } |
+func (u) LoginURLFederated(string, string) (string, error) { panic(ni()) } |
+func (u) LogoutURL(string) (string, error) { panic(ni()) } |
+func (u) OAuthConsumerKey() (string, error) { panic(ni()) } |
+ |
+var dummyUserInst = u{} |
+ |
+// User returns a dummy user.Interface implementation suitable for embedding. |
+// Every methog panics with a message containing the name of the method which |
Vadim Sh.
2015/12/03 00:55:56
typo: methog
iannucci
2015/12/03 01:00:24
hehe :)
|
+// was unimplemented. |
+func User() user.Interface { return dummyUserInst } |