Documentation ¶
Index ¶
Constants ¶
View Source
const ( SmtpType = BackendType("smtp") ConsoleType = BackendType("console") )
Variables ¶
View Source
var Backends = map[BackendType]struct{}{ SmtpType: struct{}{}, ConsoleType: struct{}{}, }
View Source
var (
ErrUnknownBackend = fmt.Errorf("unknown backend")
)
Functions ¶
func NewMessage ¶
func NewMessage() *gomail.Message
func ValidateSmtpConfig ¶
Types ¶
type BackendType ¶
type BackendType string
type ConsoleBackend ¶
type ConsoleBackend struct {
// contains filtered or unexported fields
}
func NewConsoleBackend ¶
func NewConsoleBackend() *ConsoleBackend
func (*ConsoleBackend) Close ¶
func (b *ConsoleBackend) Close()
func (*ConsoleBackend) Send ¶
func (b *ConsoleBackend) Send(m *gomail.Message) error
func (*ConsoleBackend) SetOutput ¶
func (b *ConsoleBackend) SetOutput(w io.Writer)
type MemoryBackend ¶
type MemoryBackend struct {
// contains filtered or unexported fields
}
func NewMemoryBackend ¶
func NewMemoryBackend(max int) *MemoryBackend
Just for testing purposes. Is not thread safe.
func (*MemoryBackend) Close ¶
func (b *MemoryBackend) Close()
func (*MemoryBackend) Messages ¶
func (b *MemoryBackend) Messages() <-chan *gomail.Message
func (*MemoryBackend) Send ¶
func (b *MemoryBackend) Send(m *gomail.Message) error
type SmtpBackend ¶
type SmtpBackend struct {
// contains filtered or unexported fields
}
func NewSmtpBackend ¶
func NewSmtpBackend(cfg config.Smtp) *SmtpBackend
func (*SmtpBackend) Close ¶
func (b *SmtpBackend) Close()
func (*SmtpBackend) Send ¶
func (b *SmtpBackend) Send(msg *gomail.Message) error
Click to show internal directories.
Click to hide internal directories.