backend

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2021 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

A memory backend.

Index

Constants

View Source
const Mailbox_Inbox = "INBOX"

Variables

View Source
var Delimiter = "/"

Functions

This section is empty.

Types

type Backend

type Backend struct {
}

func GetBackend

func GetBackend() *Backend

func (*Backend) Login

func (be *Backend) Login(connInfo *imap.ConnInfo, username, password string) (backend2.User, error)

type MailAccount

type MailAccount struct {
	entity.MailAccount
	Mailboxes map[string]*Mailbox
}

func (*MailAccount) CreateMailbox

func (ma *MailAccount) CreateMailbox(name string) error

func (*MailAccount) DeleteMailbox

func (ma *MailAccount) DeleteMailbox(name string) error

func (*MailAccount) GetMailbox

func (ma *MailAccount) GetMailbox(name string) (backend2.Mailbox, error)

func (*MailAccount) ListMailboxes

func (ma *MailAccount) ListMailboxes(subscribed bool) (mailboxes []backend2.Mailbox, err error)

func (*MailAccount) Logout

func (ma *MailAccount) Logout() error

func (*MailAccount) RenameMailbox

func (ma *MailAccount) RenameMailbox(existingName, newName string) error

func (*MailAccount) Username

func (ma *MailAccount) Username() string

type MailMessage

type MailMessage struct {
	entity.MailMessage
}

func (*MailMessage) Fetch

func (m *MailMessage) Fetch(seqNum uint32, items []imap.FetchItem) (*imap.Message, error)

func (*MailMessage) Match

func (m *MailMessage) Match(seqNum uint32, c *imap.SearchCriteria) (bool, error)

type Mailbox

type Mailbox struct {
	entity.MailBox
}

func (*Mailbox) Check

func (mbox *Mailbox) Check() error

func (*Mailbox) CopyMessages

func (mbox *Mailbox) CopyMessages(uid bool, seqset *imap.SeqSet, destName string) error

* 拷贝满足条件的消息到另一个收件箱

func (*Mailbox) CreateMessage

func (mbox *Mailbox) CreateMessage(flags []string, date time.Time, body imap.Literal) error

func (*Mailbox) Expunge

func (mbox *Mailbox) Expunge() error

* 删除有删除标志的信息

func (*Mailbox) Info

func (mbox *Mailbox) Info() (*imap.MailboxInfo, error)

func (*Mailbox) ListMessages

func (mbox *Mailbox) ListMessages(uid bool, seqSet *imap.SeqSet, items []imap.FetchItem, ch chan<- *imap.Message) error

func (*Mailbox) Name

func (mbox *Mailbox) Name() string

func (*Mailbox) SearchMessages

func (mbox *Mailbox) SearchMessages(uid bool, criteria *imap.SearchCriteria) ([]uint32, error)

func (*Mailbox) SetSubscribed

func (mbox *Mailbox) SetSubscribed(subscribed bool) error

func (*Mailbox) Status

func (mbox *Mailbox) Status(items []imap.StatusItem) (*imap.MailboxStatus, error)

func (*Mailbox) UpdateMessagesFlags

func (mbox *Mailbox) UpdateMessagesFlags(uid bool, seqset *imap.SeqSet, op imap.FlagsOp, flags []string) error

Jump to

Keyboard shortcuts

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