Help us shape the future of Go! Take the 2026 Go Developer Survey

memory

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package memory supplies a bounded, opt-in email recorder. It retains private message content in process memory and is intended for tests and development.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

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

Driver retains outbound messages in a bounded, mutex-protected buffer.

func New

func New(capacity int) (*Driver, error)

New creates an in-memory driver with capacity between one and 10,000 messages.

func (*Driver) Close

func (d *Driver) Close()

Close closes the driver and clears retained messages under its mutex.

func (*Driver) Format

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

Format writes a fixed label without exposing messages.

func (*Driver) Messages

func (d *Driver) Messages() []email.Outbound

Messages returns a synchronized copy of the retained message slice.

func (*Driver) Reset

func (d *Driver) Reset()

Reset clears retained messages without reopening a closed driver.

func (*Driver) Send

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

Send retains a validated outbound message, returning a transient failure if closed or full.

Jump to

Keyboard shortcuts

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