sqlite3

package
v0.0.0-...-edf14c0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SQLite3Storage

type SQLite3Storage struct {
	*TableConfig
	*TableMailboxes
	*TableMails
	*TableQueue
	// contains filtered or unexported fields
}

func NewSQLite3StorageStorage

func NewSQLite3StorageStorage(filename string) (*SQLite3Storage, error)

func (*SQLite3Storage) Close

func (s *SQLite3Storage) Close() error

type TableConfig

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

func NewTableConfig

func NewTableConfig(db *sql.DB, writer *Writer) (*TableConfig, error)

func (*TableConfig) ConfigGet

func (t *TableConfig) ConfigGet(key string) (string, error)

func (*TableConfig) ConfigSet

func (t *TableConfig) ConfigSet(key, value string) error

func (*TableConfig) ConfigSetPassword

func (t *TableConfig) ConfigSetPassword(password string) error

func (*TableConfig) ConfigTryPassword

func (t *TableConfig) ConfigTryPassword(password string) (bool, error)

type TableMailboxes

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

func NewTableMailboxes

func NewTableMailboxes(db *sql.DB, writer *Writer) (*TableMailboxes, error)

func (*TableMailboxes) MailboxCreate

func (t *TableMailboxes) MailboxCreate(name string) error

func (*TableMailboxes) MailboxDelete

func (t *TableMailboxes) MailboxDelete(name string) error

func (*TableMailboxes) MailboxList

func (t *TableMailboxes) MailboxList(onlySubscribed bool) ([]string, error)

func (*TableMailboxes) MailboxRename

func (t *TableMailboxes) MailboxRename(old, new string) error

func (*TableMailboxes) MailboxSelect

func (t *TableMailboxes) MailboxSelect(mailbox string) (bool, error)

func (*TableMailboxes) MailboxSubscribe

func (t *TableMailboxes) MailboxSubscribe(name string, subscribed bool) error

type TableMails

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

func NewTableMails

func NewTableMails(db *sql.DB, writer *Writer) (*TableMails, error)

func (*TableMails) MailCount

func (t *TableMails) MailCount(mailbox string) (int, error)

func (*TableMails) MailCreate

func (t *TableMails) MailCreate(mailbox string, data []byte) (int, error)

func (*TableMails) MailDelete

func (t *TableMails) MailDelete(mailbox string, id int) error

func (*TableMails) MailExpunge

func (t *TableMails) MailExpunge(mailbox string) error

func (*TableMails) MailIDForSeq

func (t *TableMails) MailIDForSeq(mailbox string, seq int) (int, error)

func (*TableMails) MailNextID

func (t *TableMails) MailNextID(mailbox string) (int, error)

func (*TableMails) MailSearch

func (t *TableMails) MailSearch(mailbox string) ([]uint32, error)

func (*TableMails) MailSelect

func (t *TableMails) MailSelect(mailbox string, id int) (int, *types.Mail, error)

func (*TableMails) MailUnseen

func (t *TableMails) MailUnseen(mailbox string) (int, error)

func (*TableMails) MailUpdateFlags

func (t *TableMails) MailUpdateFlags(mailbox string, id int, seen, answered, flagged, deleted bool) error

type TableQueue

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

func NewTableQueue

func NewTableQueue(db *sql.DB, writer *Writer) (*TableQueue, error)

func (*TableQueue) QueueDeleteDestinationForID

func (t *TableQueue) QueueDeleteDestinationForID(destination string, id int) error

func (*TableQueue) QueueInsertDestinationForID

func (t *TableQueue) QueueInsertDestinationForID(destination string, id int, from, rcpt string) error

func (*TableQueue) QueueListDestinations

func (t *TableQueue) QueueListDestinations() ([]string, error)

func (*TableQueue) QueueMailIDsForDestination

func (t *TableQueue) QueueMailIDsForDestination(destination string) ([]types.QueuedMail, error)

func (*TableQueue) QueueSelectIsMessagePendingSend

func (t *TableQueue) QueueSelectIsMessagePendingSend(mailbox string, id int) (bool, error)

type Writer

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

func (*Writer) Do

func (w *Writer) Do(db *sql.DB, txn *sql.Tx, f func(txn *sql.Tx) error) error

Jump to

Keyboard shortcuts

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