internal

package
v0.0.0-...-359fb6e Latest Latest
Warning

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

Go to latest
Published: May 4, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsMalformedMessageError

func IsMalformedMessageError(err error) bool

func Retry

func Retry(attempts int, sleep time.Duration, function func() (interface{}, error)) (interface{}, error)

Types

type Configuration

type Configuration struct {
	Address         string
	User            string
	Password        string
	IgnoreMailboxes []string `yaml:"ignore_mailboxes"`
	StoragePath     string   `yaml:"storage_path"`
	Timeout         string
	TimeoutDuration time.Duration
}

func (*Configuration) AssignDefaults

func (c *Configuration) AssignDefaults() error

type Downloader

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

func NewDownloader

func NewDownloader(configuration *Configuration) *Downloader

func (*Downloader) Download

func (d *Downloader) Download() error

type FileStorage

type FileStorage struct {
	BasePath string
}

func NewFileStorage

func NewFileStorage(basePath string) *FileStorage

func (*FileStorage) Load

func (s *FileStorage) Load(messageId string) (*Message, error)

func (*FileStorage) Remove

func (s *FileStorage) Remove(messageId string) error

func (*FileStorage) Save

func (s *FileStorage) Save(message *Message) error

func (*FileStorage) Search

func (s *FileStorage) Search(filter func(*Message) bool, ch chan<- *Message) error

type Message

type Message struct {
	*mail.Message

	Raw []byte
}

func NewMessage

func NewMessage(inbound io.Reader) (*Message, error)

func NewMessageFromIMAP

func NewMessageFromIMAP(inbound *imap.Message) (*Message, error)

type Printer

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

func NewPrinter

func NewPrinter(configuration *Configuration) *Printer

func (*Printer) Print

func (p *Printer) Print(messageId string) error

type Remover

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

func NewRemover

func NewRemover(configuration *Configuration) *Remover

func (*Remover) Remove

func (p *Remover) Remove(messageIds []string) error

type Reporter

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

func NewReporter

func NewReporter(configuration *Configuration) *Reporter

func (*Reporter) Report

func (r *Reporter) Report(header string) error

type Searcher

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

func NewSearcher

func NewSearcher(configuration *Configuration) *Searcher

func (*Searcher) Search

func (d *Searcher) Search(keywords []string) error

type Storage

type Storage interface {
	Save(message *Message) error
	Search(filter func(*Message) bool, ch chan<- *Message) error
	Load(messageId string) (*Message, error)
	Remove(messageId string) error
}

Jump to

Keyboard shortcuts

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