2018-10-25 15:51:47 +02:00
|
|
|
package messenger
|
|
|
|
|
2019-07-18 09:10:48 +02:00
|
|
|
import "net/textproto"
|
|
|
|
|
2018-10-25 15:51:47 +02:00
|
|
|
// Messenger is an interface for a generic messaging backend,
|
|
|
|
// for instance, e-mail, SMS etc.
|
|
|
|
type Messenger interface {
|
|
|
|
Name() string
|
|
|
|
|
2019-07-18 09:10:48 +02:00
|
|
|
Push(fromAddr string, toAddr []string, subject string, message []byte, atts []*Attachment) error
|
2018-10-25 15:51:47 +02:00
|
|
|
Flush() error
|
|
|
|
}
|
2019-07-18 09:10:48 +02:00
|
|
|
|
|
|
|
// Attachment represents a file or blob attachment that can be
|
|
|
|
// sent along with a message by a Messenger.
|
|
|
|
type Attachment struct {
|
|
|
|
Name string
|
|
|
|
Header textproto.MIMEHeader
|
|
|
|
Content []byte
|
|
|
|
}
|