mailpit

package
v0.58.2 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClientWithInterfaces

func NewClientWithInterfaces(httpClient http.Client, conf Config) *client

Types

type Account

type Account struct {
	Address string `json:"Address"`
	Name    string `json:"Name"`
}

type Attachment

type Attachment struct {
	ContentID   string `json:"ContentID"`
	ContentType string `json:"ContentType"`
	FileName    string `json:"FileName"`
	PartID      string `json:"PartID"`
	Size        int    `json:"Size"`
}

type Client

type Client interface {
	ListMessages(ctx context.Context) (*ListMessagesResponse, error)
	GetMessage(ctx context.Context, id string) (*Message, error)
}

func ProvideClient

func ProvideClient(ctx context.Context, config cfg.Config, _ log.Logger) (Client, error)

type Config

type Config struct {
	Server   string `cfg:"server"`
	Protocol string `cfg:"protocol" default:"http"`
}

type ListMessagesResponse

type ListMessagesResponse struct {
	Messages []MessageSummary `json:"Messages"`
}

type Message

type Message struct {
	Attachments []Attachment `json:"Attachments"`
	Bcc         []Account    `json:"Bcc"`
	Cc          []Account    `json:"Cc"`
	Date        string       `json:"Date"`
	From        Account      `json:"From"`
	HTML        string       `json:"HTML"`
	ID          string       `json:"ID"`
	Inline      []Attachment `json:"Inline"`
	MessageID   string       `json:"MessageID"`
	ReplyTo     []Account    `json:"ReplyTo"`
	ReturnPath  string       `json:"ReturnPath"`
	Size        int          `json:"Size"`
	Subject     string       `json:"Subject"`
	Tags        []string     `json:"Tags"`
	Text        string       `json:"Text"`
	To          []Account    `json:"To"`
}

type MessageSummary

type MessageSummary struct {
	Attachments int       `json:"Attachments"`
	Bcc         []Account `json:"Bcc"`
	Cc          []Account `json:"Cc"`
	Created     time.Time `json:"Created"`
	From        Account   `json:"From"`
	ID          string    `json:"ID"`
	MessageID   string    `json:"MessageID"`
	Read        bool      `json:"Read"`
	ReplyTo     []Account `json:"ReplyTo"`
	Size        int       `json:"Size"`
	Snippet     string    `json:"Snippet"`
	Subject     string    `json:"Subject"`
	Tags        []string  `json:"Tags"`
	To          []Account `json:"To"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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