drivers

package
v0.9.7 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LocalDriver

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

LocalDriver sends emails via SMTP or sendmail. The username and password fields contain sensitive credentials and must not be logged.

func NewLocalDriver

func NewLocalDriver() (*LocalDriver, error)

NewLocalDriver creates a new local SMTP/sendmail driver

func (*LocalDriver) Send

func (d *LocalDriver) Send(ctx context.Context, msg *mail.Message) error

Send sends an email via SMTP or sendmail

func (*LocalDriver) String added in v0.9.2

func (d *LocalDriver) String() string

String returns a safe representation with credentials redacted.

type LogDriver

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

LogDriver logs emails instead of sending them (for development)

func NewLogDriver

func NewLogDriver() *LogDriver

NewLogDriver creates a new log driver

func (*LogDriver) ClearLog

func (d *LogDriver) ClearLog()

ClearLog clears the logged emails (for testing)

func (*LogDriver) GetLog

func (d *LogDriver) GetLog() []string

GetLog returns all logged emails (for testing)

func (*LogDriver) Send

func (d *LogDriver) Send(ctx context.Context, msg *mail.Message) error

Send logs the email instead of sending it

type MailgunDriver

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

MailgunDriver sends emails via Mailgun API. The apiKey and webhookSigningKey fields contain sensitive credentials and must not be logged.

func NewMailgunDriver

func NewMailgunDriver() (*MailgunDriver, error)

NewMailgunDriver creates a new Mailgun driver

func (*MailgunDriver) ParseWebhook

func (d *MailgunDriver) ParseWebhook(body []byte) (map[string]interface{}, error)

ParseWebhook parses a Mailgun webhook event (for future use)

func (*MailgunDriver) Send

func (d *MailgunDriver) Send(ctx context.Context, msg *mail.Message) error

Send sends an email via Mailgun API

func (*MailgunDriver) String added in v0.9.2

func (d *MailgunDriver) String() string

String returns a safe representation with credentials redacted.

func (*MailgunDriver) VerifyWebhookSignature

func (d *MailgunDriver) VerifyWebhookSignature(timestamp, token, signature string) bool

VerifyWebhookSignature verifies a Mailgun webhook signature using HMAC-SHA256. The signature is computed as HMAC-SHA256(webhookSigningKey, timestamp+token).

type PostmarkDriver

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

PostmarkDriver sends emails via Postmark API. The token field contains sensitive credentials and must not be logged.

func NewPostmarkDriver

func NewPostmarkDriver() (*PostmarkDriver, error)

NewPostmarkDriver creates a new Postmark driver

func (*PostmarkDriver) Send

func (d *PostmarkDriver) Send(ctx context.Context, msg *mail.Message) error

Send sends an email via Postmark API

func (*PostmarkDriver) String added in v0.9.2

func (d *PostmarkDriver) String() string

String returns a safe representation with credentials redacted.

Jump to

Keyboard shortcuts

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