Single user refactor

This commit is contained in:
Neil Alexander
2021-07-09 00:08:26 +01:00
parent 8411468451
commit 0735fa74de
15 changed files with 190 additions and 233 deletions

View File

@@ -5,24 +5,24 @@ import "time"
type Storage interface {
ConfigGet(key string) (string, error)
ConfigSet(key, value string) error
ConfigSetPassword(password string) error
ConfigTryPassword(password string) (bool, error)
TryAuthenticate(username, password string) (bool, error)
MailboxSelect(mailbox string) (bool, error)
MailNextID(mailbox string) (int, error)
MailIDForSeq(mailbox string, id int) (int, error)
MailUnseen(mailbox string) (int, error)
MailboxList(onlySubscribed bool) ([]string, error)
MailboxCreate(name string) error
MailboxRename(old, new string) error
MailboxDelete(name string) error
MailboxSubscribe(name string, subscribed bool) error
MailboxSelect(user, mailbox string) (bool, error)
MailNextID(user, mailbox string) (int, error)
MailIDForSeq(user, mailbox string, id int) (int, error)
MailUnseen(user, mailbox string) (int, error)
MailboxList(user string, onlySubscribed bool) ([]string, error)
MailboxCreate(user, name string) error
MailboxRename(user, old, new string) error
MailboxDelete(user, name string) error
MailboxSubscribe(user, name string, subscribed bool) error
MailCreate(user, mailbox string, data []byte) (int, error)
MailSelect(user, mailbox string, id int) (int, int, []byte, bool, bool, bool, bool, time.Time, error)
MailSearch(user, mailbox string) ([]uint32, error)
MailUpdateFlags(user, mailbox string, id int, seen, answered, flagged, deleted bool) error
MailDelete(user, mailbox, id string) error
MailExpunge(user, mailbox string) error
MailCount(user, mailbox string) (int, error)
MailCreate(mailbox string, data []byte) (int, error)
MailSelect(mailbox string, id int) (int, int, []byte, bool, bool, bool, bool, time.Time, error)
MailSearch(mailbox string) ([]uint32, error)
MailUpdateFlags(mailbox string, id int, seen, answered, flagged, deleted bool) error
MailDelete(mailbox, id string) error
MailExpunge(mailbox string) error
MailCount(mailbox string) (int, error)
}