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

Side by Side Diff: service/mail/interface.go

Issue 2302743002: Interface update, per-method Contexts. (Closed)
Patch Set: Lightning talk licenses. Created 4 years, 3 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 | « service/mail/context.go ('k') | service/memcache/context.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 LUCI Authors. All rights reserved. 1 // Copyright 2015 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0 2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file. 3 // that can be found in the LICENSE file.
4 4
5 package mail 5 package mail
6 6
7 // Interface is the interface for all of the mail methods. 7 import (
8 » "golang.org/x/net/context"
9 )
10
11 // RawInterface is the interface for all of the mail methods.
8 // 12 //
9 // These replicate the methods found here: 13 // These replicate the methods found here:
10 // https://godoc.org/google.golang.org/appengine/mail 14 // https://godoc.org/google.golang.org/appengine/mail
11 type Interface interface { 15 type RawInterface interface {
12 Send(msg *Message) error 16 Send(msg *Message) error
13 SendToAdmins(msg *Message) error 17 SendToAdmins(msg *Message) error
14 18
15 » Testable() Testable 19 » GetTestable() Testable
16 } 20 }
21
22 // Send sends an e-mail message.
23 func Send(c context.Context, msg *Message) error {
24 return Raw(c).Send(msg)
25 }
26
27 // SendToAdmins sends an e-mail message to application administrators.
28 func SendToAdmins(c context.Context, msg *Message) error {
29 return Raw(c).SendToAdmins(msg)
30 }
31
32 // GetTestable returns a testable extension interface, or nil if one is not
33 // available.
34 func GetTestable(c context.Context) Testable {
35 return Raw(c).GetTestable()
36 }
OLDNEW
« no previous file with comments | « service/mail/context.go ('k') | service/memcache/context.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698