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 ¶ added in v0.6.0
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) }
Mail is an interface that handles the common operations for email messages
type MailWorker ¶
type MailWorker struct {
Queue chan []Mail
}
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.
var Mailer *MailWorker
Mailer is a global instance of the mailer that can be used in applications. It is the responsibility of the application to call Mailer.Start()
func NewMailWorker ¶
func NewMailWorker() *MailWorker
NewMailWorker returns an instance of MailWorker with the mail queue initialized.
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.