email

package
v0.0.0-...-c937b9e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 17, 2015 License: MIT Imports: 5 Imported by: 6

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

func ValidateSmtpConfig(cfg config.Smtp) error

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 Email

type Email struct {
	// contains filtered or unexported fields
}

func New

func New(cfg config.Email) (*Email, error)

func (*Email) Close

func (e *Email) Close()

func (*Email) Send

func (e *Email) Send(msg *gomail.Message) error

func (*Email) SetConfig

func (e *Email) SetConfig(cfg config.Email) error

type Mailer

type Mailer interface {
	Send(*gomail.Message) error
	Close()
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL