Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeAttachmentHeader ¶
func MakeAttachmentHeader(filename, encoding string) textproto.MIMEHeader
MakeAttachmentHeader is a helper function that returns a textproto.MIMEHeader tailored for attachments, primarily email. If no encoding is given, base64 is assumed.
Types ¶
type Attachment ¶
type Attachment struct { Name string Header textproto.MIMEHeader Content []byte }
Attachment represents a file or blob attachment that can be sent along with a message by a Messenger.
type Messenger ¶
type Messenger interface { Name() string Push(fromAddr string, toAddr []string, subject string, message []byte, atts []*Attachment) error Flush() error }
Messenger is an interface for a generic messaging backend, for instance, e-mail, SMS etc.
func NewEmailer ¶
NewEmailer creates and returns an e-mail Messenger backend. It takes multiple SMTP configurations.
type Server ¶
type Server struct { Name string Host string `koanf:"host"` Port int `koanf:"port"` AuthProtocol string `koanf:"auth_protocol"` Username string `koanf:"username"` Password string `koanf:"password"` HelloHostname string `koanf:"hello_hostname"` SendTimeout time.Duration `koanf:"send_timeout"` MaxConns int `koanf:"max_conns"` // contains filtered or unexported fields }
Server represents an SMTP server's credentials.
Click to show internal directories.
Click to hide internal directories.