Versions in this module Expand all Collapse all v1 v1.8.12 Nov 16, 2021 v1.8.11 Nov 15, 2021 Changes in this version + const PathDelimiter + const UserFoldersMailboxName + const UserFoldersPrefix + const UserLabelsMailboxName + const UserLabelsPrefix + var ErrAllMailOpNotAllowed = errors.New("operation not allowed for 'All Mail' folder") + var ErrNoSuchAPIID = errors.New("no such api id") + var ErrNoSuchSeqNum = errors.New("no such sequence number") + var ErrNoSuchUID = errors.New("no such uid") + func RemoveStore(cache *Cache, path, userID string) error + type Address struct + func (storeAddress *Address) APIAddress() *pmapi.Address + func (storeAddress *Address) AddressID() string + func (storeAddress *Address) AddressString() string + func (storeAddress *Address) CreateMailbox(name string) error + func (storeAddress *Address) GetMailbox(name string) (*Mailbox, error) + func (storeAddress *Address) ListMailboxes() []*Mailbox + type AddressInfo struct + Address string + AddressID string + type BridgeUser interface + CloseAllConnections func() + CloseConnection func(string) + GetAddressID func(address string) (string, error) + GetClient func() pmapi.Client + GetPrimaryAddress func() string + GetStoreAddresses func() []string + ID func() string + IsCombinedAddressMode func() bool + IsConnected func() bool + Logout func() error + UpdateUser func(context.Context) error + type Cache struct + func NewCache(path string) *Cache + type ChangeNotifier interface + CanDelete func(mailboxID string) (bool, func()) + DeleteMessage func(address, mailboxName string, sequenceNumber uint32) + MailboxCreated func(address, mailboxName string) + MailboxStatus func(address, mailboxName string, total, unread, unreadSeqNum uint32) + Notice func(address, notice string) + UpdateMessage func(address, mailboxName string, uid, sequenceNumber uint32, msg *pmapi.Message, ...) + type Mailbox struct + func (storeMailbox *Mailbox) Color() string + func (storeMailbox *Mailbox) Delete() error + func (storeMailbox *Mailbox) FetchMessage(apiID string) (*Message, error) + func (storeMailbox *Mailbox) GetAPIIDsFromSequenceRange(start, stop uint32) (apiIDs []string, err error) + func (storeMailbox *Mailbox) GetAPIIDsFromUIDRange(start, stop uint32) (apiIDs []string, err error) + func (storeMailbox *Mailbox) GetCounts() (total, unread, unseenSeqNum uint, err error) + func (storeMailbox *Mailbox) GetDeletedAPIIDs() (apiIDs []string, err error) + func (storeMailbox *Mailbox) GetDelimiter() string + func (storeMailbox *Mailbox) GetLatestAPIID() (apiID string, err error) + func (storeMailbox *Mailbox) GetMessage(apiID string) (*Message, error) + func (storeMailbox *Mailbox) GetNextUID() (uid uint32, err error) + func (storeMailbox *Mailbox) GetUIDByHeader(header *mail.Header) (foundUID uint32) + func (storeMailbox *Mailbox) GetUIDList(apiIDs []string) *uidplus.OrderedSeq + func (storeMailbox *Mailbox) ImportMessage(enc []byte, seen bool, labelIDs []string, flags, time int64) (string, error) + func (storeMailbox *Mailbox) IsFolder() bool + func (storeMailbox *Mailbox) IsLabel() bool + func (storeMailbox *Mailbox) IsSystem() bool + func (storeMailbox *Mailbox) LabelID() string + func (storeMailbox *Mailbox) LabelMessages(apiIDs []string) error + func (storeMailbox *Mailbox) MarkMessagesDeleted(apiIDs []string) error + func (storeMailbox *Mailbox) MarkMessagesRead(apiIDs []string) error + func (storeMailbox *Mailbox) MarkMessagesStarred(apiIDs []string) error + func (storeMailbox *Mailbox) MarkMessagesUndeleted(apiIDs []string) error + func (storeMailbox *Mailbox) MarkMessagesUnread(apiIDs []string) error + func (storeMailbox *Mailbox) MarkMessagesUnstarred(apiIDs []string) error + func (storeMailbox *Mailbox) Name() string + func (storeMailbox *Mailbox) RemoveDeleted(apiIDs []string) error + func (storeMailbox *Mailbox) Rename(newName string) error + func (storeMailbox *Mailbox) UIDValidity() uint32 + func (storeMailbox *Mailbox) UnlabelMessages(apiIDs []string) error + type Message struct + func (message *Message) GetBodyStructure() (bs *pkgMsg.BodyStructure, err error) + func (message *Message) GetHeader() []byte + func (message *Message) GetMIMEHeader() textproto.MIMEHeader + func (message *Message) ID() string + func (message *Message) IncreaseBuildCount() (times uint32, err error) + func (message *Message) IsFullHeaderCached() bool + func (message *Message) IsMarkedDeleted() bool + func (message *Message) Message() *pmapi.Message + func (message *Message) SequenceNumber() (uint32, error) + func (message *Message) SetBodyStructure(bs *pkgMsg.BodyStructure) error + func (message *Message) SetContentTypeAndHeader(mimeType string, header mail.Header) error + func (message *Message) SetHeader(header []byte) error + func (message *Message) SetSize(size int64) error + func (message *Message) UID() (uint32, error) + type PanicHandler interface + HandlePanic func() + type Store struct + func New(sentryReporter *sentry.Reporter, panicHandler PanicHandler, user BridgeUser, ...) (store *Store, err error) + func (store *Store) Close() error + func (store *Store) CloseEventLoop() + func (store *Store) CreateDraft(kr *crypto.KeyRing, message *pmapi.Message, attachmentReaders []io.Reader, ...) (*pmapi.Message, []*pmapi.Attachment, error) + func (store *Store) GetAddress(addressID string) (*Address, error) + func (store *Store) GetAddressID(addr string) (id string, err error) + func (store *Store) GetAddressInfo() (addrs []AddressInfo, err error) + func (store *Store) GetMaxUpload() (int64, error) + func (store *Store) GetSpace() (usedSpace, maxSpace uint, err error) + func (store *Store) IsCombinedMode() bool + func (store *Store) RebuildMailboxes() (err error) + func (store *Store) Remove() (err error) + func (store *Store) SendMessage(messageID string, req *pmapi.SendMessageReq) error + func (store *Store) SetChangeNotifier(notifier ChangeNotifier) + func (store *Store) TestDumpDB(tb assert.TestingT) + func (store *Store) TestGetEventLoop() *eventLoop + func (store *Store) TestGetLastEvent() *pmapi.Event + func (store *Store) TestGetStoreFilePath() string + func (store *Store) TestIsSyncRunning() bool + func (store *Store) TestPollNow() + func (store *Store) TestSync() + func (store *Store) UseCombinedMode(useCombined bool) (err error) + func (store *Store) UserID() string