fake

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package fake provides an in-memory mail.Provider for tests and offline development, so UI behavior can be exercised without network access.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider struct {
	AccountAddr string
	LabelList   []mail.Label
	ThreadList  []mail.Thread
	Messages    map[string][]mail.Message

	// Sent records everything delivered through Send, for assertions.
	Sent []mail.Draft

	// Err, when set, is returned by every call.
	Err error
	// contains filtered or unexported fields
}

Provider is an in-memory implementation of mail.Provider.

func New

func New() *Provider

New returns a provider seeded with a small, realistic mailbox.

func (*Provider) Account

func (p *Provider) Account() string

func (*Provider) Attachment

func (p *Provider) Attachment(context.Context, string, string) ([]byte, error)

func (*Provider) Labels

func (p *Provider) Labels(context.Context) ([]mail.Label, error)

func (*Provider) Modify

func (p *Provider) Modify(_ context.Context, threadIDs []string, add, remove []string) error

func (*Provider) Name

func (p *Provider) Name() string

func (*Provider) Send

func (p *Provider) Send(_ context.Context, d mail.Draft) error

func (*Provider) Thread

func (p *Provider) Thread(_ context.Context, id string) ([]mail.Message, error)

func (*Provider) Threads

Jump to

Keyboard shortcuts

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