Documentation
¶
Overview ¶
Package sender sends email in the background, so endpoints respond without waiting for the email provider.
Responding first keeps response times the same whether or not an email was sent, so timing can't reveal whether an account exists. Messages aren't stored anywhere: they contain live tokens, and persisting them would undo the point of storing only token hashes. The cost is that a message still being sent when the process stops is lost; Close keeps that window small on a normal shutdown.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrClosed = errors.New("sender: already closed")
ErrClosed is returned by Close if it was already called.
Functions ¶
This section is empty.
Types ¶
type Sender ¶
type Sender struct {
// contains filtered or unexported fields
}
Sender sends messages in the background through a Mailer.
func (*Sender) Close ¶
Close stops accepting messages and waits for messages already accepted to be sent, or to fail their last retry, until ctx is done. Pending retries run immediately instead of waiting.