failover

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package failover composes borrowed email transports. A send moves to the next transport only after a Transient failure: a known non-acceptance. Permanent, Construction and Ambiguous outcomes stop immediately, because an ambiguous submission may already have been accepted and trying another transport could deliver the message twice.

Index

Constants

View Source
const MaxTransports = 8

MaxTransports bounds one composition.

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

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

Driver borrows its transports; close them after the owning mailer drains. It renders MIME for every transport, which provider API drivers accept too.

func New

func New(transports ...email.Driver) (*Driver, error)

New tries transports in order on every send.

func RoundRobin

func RoundRobin(transports ...email.Driver) (*Driver, error)

RoundRobin starts each send at the next transport in turn, spreading load, and fails over through the others in order.

func (*Driver) Format

func (*Driver) Format(s fmt.State, _ rune)

func (*Driver) Send

func (d *Driver) Send(ctx context.Context, out email.Outbound) (email.Receipt, error)

Jump to

Keyboard shortcuts

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