Documentation ¶
Overview ¶
Package sender provides a common interface for creating new aaronland/gomail/v2 instances using a URI-based syntax.
Index ¶
- func NewNullSender(ctx context.Context, uri string) (gomail.Sender, error)
- func NewSMTPSender(ctx context.Context, uri string) (gomail.Sender, error)
- func NewSender(ctx context.Context, uri string) (gomail.Sender, error)
- func NewStdoutSender(ctx context.Context, uri string) (gomail.Sender, error)
- func RegisterSender(ctx context.Context, scheme string, f SenderInitializeFunc) error
- func Schemes() []string
- type NullSender
- type SenderInitializeFunc
- type StdoutSender
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewNullSender ¶
NewNullSender returns a new `NullSender` instance for delivery messages to nowhere, configured by 'uri' which is expected to take the form of:
$> null://
func NewSMTPSender ¶
NewSMTPSender returns a new `gomail.Sender` instance for delivery mail to a SMTP endpoint. 'uri' is expecteed to take the form of:
smtp://{HOST}?port={PORT}&username={USERNAME}&password={PASSWORD}
Where ${HOST} is the name of the SMTP server host; {PORT} is the name of the SMTP server port; {USERNAME} and {PASSWORD} are the authentication credentials for accessing the SMTP server.
func NewSender ¶
Create a new instance of the Sender interface. Sender instances are created by passing in a context.Context instance and a URI string. The form and substance of URI strings are specific to their implementations.
func NewStdoutSender ¶
NewStdoutSender returns a new `NullSender` instance for delivery messages to STDOUT, configured by 'uri' which is expected to take the form of:
$> stdout://
func RegisterSender ¶
func RegisterSender(ctx context.Context, scheme string, f SenderInitializeFunc) error
Register a new URI scheme and SenderInitializeFunc function for a implementation of the Sender interface.
Types ¶
type NullSender ¶
type NullSender struct {
gomail.Sender
}
NullSender implements the `gomail.Sender` inferface for delivery messages to nowhere.
type SenderInitializeFunc ¶
The initialization function signature for implementation of the Sender interface.
type StdoutSender ¶
type StdoutSender struct {
gomail.Sender
}
NullSender implements the `gomail.Sender` inferface for delivery messages to STDOUT.