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

Unified Diff: service/mail/interface.go

Issue 2302743002: Interface update, per-method Contexts. (Closed)
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: service/mail/interface.go
diff --git a/service/mail/interface.go b/service/mail/interface.go
index efc12581599d1531750c9a335e49f1a526f0cc4f..0306b339a7c3b7206ebf8346efd8f5ccf85b25cb 100644
--- a/service/mail/interface.go
+++ b/service/mail/interface.go
@@ -4,13 +4,33 @@
package mail
-// Interface is the interface for all of the mail methods.
+import (
+ "golang.org/x/net/context"
+)
+
+// RawInterface is the interface for all of the mail methods.
//
// These replicate the methods found here:
// https://godoc.org/google.golang.org/appengine/mail
-type Interface interface {
+type RawInterface interface {
Send(msg *Message) error
SendToAdmins(msg *Message) error
- Testable() Testable
+ GetTestable() Testable
+}
+
+// Send sends an e-mail message.
+func Send(c context.Context, msg *Message) error {
+ return Raw(c).Send(msg)
+}
+
+// SendToAdmins sends an e-mail message to application administrators.
+func SendToAdmins(c context.Context, msg *Message) error {
+ return Raw(c).SendToAdmins(msg)
+}
+
+// GetTestable returns a testable extension interface, or nil if one is not
+// available.
+func GetTestable(c context.Context) Testable {
+ return Raw(c).GetTestable()
}

Powered by Google App Engine
This is Rietveld 408576698