Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigMailer ¶
type ConfigMailer struct { From string NameFrom string Pass string // Pass is sendgrid api key. MinRetryDelay time.Duration MaxRetryDelay time.Duration }
ConfigMailer - config structure for sending email.
type ExpDelay ¶
type ExpDelay struct {
// contains filtered or unexported fields
}
ExpDelay implements exponential delay and provides a convenient way to exponential delay..
func NewExpDelay ¶
New returns new exponential delay which start with min delay, increase each next delay in 2 times up to max delay.
for delay := expdelay.New(minDelay, maxDelay); ; delay.Sleep() { err := op() if err == nil { break } }
type Mail ¶
type Mail struct {
// contains filtered or unexported fields
}
Mail contains mail struct.
type Mailer ¶
type Mailer struct {
// contains filtered or unexported fields
}
Mailer - struct with config and methods for sending emails. Wrapping the sendgrid api
func NewMailer ¶
func NewMailer(log *structlog.Logger, config ConfigMailer) *Mailer
NewMailer - create new instance Mailer with checking the delays for correctness.
func (*Mailer) CreateEmail ¶
CreateEmail gets email props and returns prepared mail for SendEmail method.
Click to show internal directories.
Click to hide internal directories.