mailertest

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package mailertest is an in-memory mailer.Sender for tests of the packages that send email.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sender

type Sender struct {
	Err error
	// contains filtered or unexported fields
}

Sender keeps every message it is given. Set Err to make the next sends fail, as a mail server that cannot be reached or refuses would; a failed send keeps nothing.

func (*Sender) Send

func (s *Sender) Send(ctx context.Context, m mailer.Message) error

Send records m, or returns Err.

func (*Sender) Sent

func (s *Sender) Sent() []mailer.Message

Sent returns the messages sent so far, oldest first.

func (*Sender) SetErr

func (s *Sender) SetErr(err error)

SetErr changes Err while sends may be running.

func (*Sender) Tries

func (s *Sender) Tries() int

Tries counts the sends attempted, failed ones included.

Jump to

Keyboard shortcuts

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