Initial commit

This commit is contained in:
Neil Alexander
2021-07-07 18:15:07 +01:00
commit ceffe7612d
26 changed files with 2130 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
package storage
import "time"
type Storage interface {
ConfigGet(key string) (string, error)
ConfigSet(key, value string) error
TryAuthenticate(username, password string) (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)
}