mail

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Body

type Body struct {
	Text string `json:"text"`
	HTML string `json:"html"`
}

Body is the body of a mail.

type Header struct {
	Address string    `json:"address"`
	ID      string    `json:"id"`
	From    string    `json:"from"`
	To      []string  `json:"to"`
	Subject string    `json:"subject"`
	Date    time.Time `json:"date"`
	Size    int64     `json:"size"`
	Seen    bool      `json:"seen"`
}

Header is the header of a mail.

type Mailer

type Mailer interface {
	// List returns a list of message headers for the requested address.
	List(ctx context.Context, address string) ([]*Header, error)

	// Get returns the message body by a address name and message ID.
	Get(ctx context.Context, address string, id string) (*Body, error)

	// Del deletes a single message given the address name and message ID.
	Del(ctx context.Context, address string, id string) error

	// Clear deletes all messages in the given address.
	Clear(ctx context.Context, address string) error

	// Domain returns the domain of the mailer.
	Domain() string
}

Mailer is a mail client to send and get mails.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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