Documentation
¶
Overview ¶
Package cache stores fetched mail locally so Postline can render a mailbox before the network responds. It is strictly an accelerator: deleting the database costs nothing but a refetch.
Index ¶
- Constants
- func DefaultPath() (string, error)
- func Remove() error
- type Store
- func (s *Store) Clear(account string) error
- func (s *Store) Close() error
- func (s *Store) Labels(account string) []mail.Label
- func (s *Store) Messages(account, threadID string) []mail.Message
- func (s *Store) SaveLabels(account string, labels []mail.Label) error
- func (s *Store) SaveMessages(account, threadID string, msgs []mail.Message) error
- func (s *Store) SaveThreads(account, labelID string, threads []mail.Thread) error
- func (s *Store) Threads(account, labelID string) []mail.Thread
Constants ¶
View Source
const DirEnv = "POSTLINE_CACHE_DIR"
DirEnv relocates the cache. Tests set it so a run cannot write fixture mail into the cache of whoever is running them.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is a local cache. Every method tolerates a nil receiver, so callers can treat an unavailable cache as a no-op rather than branching everywhere.
func (*Store) SaveLabels ¶
SaveLabels caches the mailbox list.
func (*Store) SaveMessages ¶
SaveMessages caches a conversation.
func (*Store) SaveThreads ¶
SaveThreads caches the first page of a mailbox.
Click to show internal directories.
Click to hide internal directories.