Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CapturingMailer ¶ added in v1.8.0
type CapturingMailer struct {
// contains filtered or unexported fields
}
CapturingMailer is a domain.Mailer implementation that captures sent OTP codes. Use in integration/smoke tests to inspect OTP codes without a real SMTP server.
func NewCapturingMailer ¶ added in v1.8.0
func NewCapturingMailer() *CapturingMailer
NewCapturingMailer constructs a CapturingMailer.
func (*CapturingMailer) OTPFor ¶ added in v1.8.0
func (m *CapturingMailer) OTPFor(email string) string
OTPFor returns the most recently sent OTP code for the given email. Returns an empty string if no OTP has been sent.
type NoopMailer ¶
type NoopMailer struct{}
NoopMailer is a domain.Mailer implementation that discards all emails. Use in unit tests and local development.
type SMTPMailer ¶
type SMTPMailer struct {
// contains filtered or unexported fields
}
SMTPMailer implements domain.Mailer via net/smtp.
func NewSMTPMailer ¶
func NewSMTPMailer(host string, port int, username, password, from string) (*SMTPMailer, error)
NewSMTPMailer constructs an SMTPMailer. Returns an error if required fields are empty.
Click to show internal directories.
Click to hide internal directories.