Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var MaxReconnectAttempts = 10
MaxReconnectAttempts is the maximum number of times we should reconnect to a server
Functions ¶
This section is empty.
Types ¶
type ErrMaxConnectAttempts ¶
type ErrMaxConnectAttempts struct {
// contains filtered or unexported fields
}
ErrMaxConnectAttempts is thrown when the maximum number of reconnect attempts is reached.
func (*ErrMaxConnectAttempts) Error ¶
func (e *ErrMaxConnectAttempts) Error() string
Error returns the wrapped error response
type Mail ¶
type Mail interface { Backoff(reason error) error Error(err error) error Success() error Generate(msg *gomail.Message) error GetDialer() (Dialer, error) GetSmtpFrom() (string, error) }
Mail is an interface that handles the common operations for email messages
type MailWorker ¶
type MailWorker struct {
// contains filtered or unexported fields
}
MailWorker is the worker that receives slices of emails on a channel to send. It's assumed that every slice of emails received is meant to be sent to the same server.
func NewMailWorker ¶
func NewMailWorker() *MailWorker
NewMailWorker returns an instance of MailWorker with the mail queue initialized.
func (*MailWorker) Queue ¶
func (mw *MailWorker) Queue(ms []Mail)
Queue sends the provided mail to the internal queue for processing.
func (*MailWorker) Start ¶
func (mw *MailWorker) Start(ctx context.Context)
Start launches the mail worker to begin listening on the Queue channel for new slices of Mail instances to process.