Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrDriverRequired = errors.New("email: driver is required") ErrUnknownDriver = errors.New("email: unknown driver") )
Functions ¶
func RegisterDriver ¶
func RegisterDriver(driver string, factory DriverFactory)
Types ¶
type AttemptResult ¶
type AttemptResult struct {
Provider string
Success bool
Result *ProviderResult
Error error
}
type DriverFactory ¶
type DriverFactory func(name string, cfg ProviderConfig) (Provider, error)
type Middleware ¶
type Provider ¶
type Provider interface {
Send(ctx context.Context, msg Message) (*ProviderResult, error)
Close() error
}
func NewProvider ¶
func NewProvider(name string, cfg ProviderConfig) (Provider, error)
type ProviderConfig ¶
type ProviderConfig struct {
Driver string `mapstructure:"driver" yaml:"driver"`
Host string `mapstructure:"host" yaml:"host"`
Port int `mapstructure:"port" yaml:"port"`
Username string `mapstructure:"username" yaml:"username"`
Password string `mapstructure:"password" yaml:"password"`
FromAddress string `mapstructure:"from_address" yaml:"from_address"`
FromName string `mapstructure:"from_name" yaml:"from_name"`
ReplyTo string `mapstructure:"reply_to" yaml:"reply_to"`
Encryption string `mapstructure:"encryption" yaml:"encryption"`
Auth string `mapstructure:"auth" yaml:"auth"`
Timeout time.Duration `mapstructure:"timeout" yaml:"timeout"`
}
func (ProviderConfig) Clone ¶
func (c ProviderConfig) Clone() ProviderConfig
type ProviderResult ¶
type SendResult ¶
type SendResult struct {
Provider string
Attempts []AttemptResult
}
type SenderFunc ¶
type SenderFunc func(ctx context.Context, req Request) (*SendResult, error)
func (SenderFunc) Send ¶
func (fn SenderFunc) Send(ctx context.Context, req Request) (*SendResult, error)
Click to show internal directories.
Click to hide internal directories.