2016-04-19 07:22:23 +03:00
|
|
|
package notifier
|
|
|
|
|
|
|
|
import "golang.org/x/net/context"
|
|
|
|
|
2016-04-19 09:55:06 +03:00
|
|
|
//go:generate mockery -name Sender -output mock -case=underscore
|
2016-04-19 07:22:23 +03:00
|
|
|
|
|
|
|
// Sender defines a notification provider that is capable of sending out
|
|
|
|
// notifications to a list of maintainers or reviewers. An example provider
|
|
|
|
// might be a Slack or GitHub bot.
|
|
|
|
type Sender interface {
|
|
|
|
Send(*Notification) error
|
|
|
|
}
|
|
|
|
|
|
|
|
// Send sends a notification to the list of maintainers indicating a commit is
|
|
|
|
// ready for their review and possible approval.
|
|
|
|
func Send(c context.Context, n *Notification) error {
|
|
|
|
return FromContext(c).Send(n)
|
|
|
|
}
|