memory

package
Version: v0.0.0-...-321511a Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Stores data in memory.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAddresses

func NewAddresses() backend.AddressesBackend

func NewAttachments

func NewAttachments() backend.AttachmentsBackend

func NewContacts

func NewContacts() backend.ContactsBackend

func NewConversations

func NewConversations(messages *Messages) backend.ConversationsBackend

func NewDomains

func NewDomains() backend.DomainsBackend

func NewEvents

func NewEvents() backend.EventsBackend

func NewKeys

func NewKeys() backend.KeysBackend

func NewLabels

func NewLabels() backend.LabelsBackend

func NewMessages

func NewMessages(attachments *Attachments) backend.MessagesBackend

func Populate

func Populate(b *backend.Backend) (err error)

func Use

func Use(bkd *backend.Backend)

Types

type Addresses

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

func (*Addresses) DeleteAddress

func (b *Addresses) DeleteAddress(user, id string) (err error)

func (*Addresses) GetAddress

func (b *Addresses) GetAddress(user, id string) (address *backend.Address, err error)

func (*Addresses) InsertAddress

func (b *Addresses) InsertAddress(user string, addr *backend.Address) (*backend.Address, error)

func (*Addresses) ListAddresses

func (b *Addresses) ListAddresses(user string) (addrs []*backend.Address, err error)

func (*Addresses) UpdateAddress

func (b *Addresses) UpdateAddress(user string, update *backend.AddressUpdate) (addr *backend.Address, err error)

type Attachments

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

func (*Attachments) DeleteAttachment

func (b *Attachments) DeleteAttachment(user, id string) (err error)

func (*Attachments) InsertAttachment

func (b *Attachments) InsertAttachment(user string, att *backend.Attachment, contents []byte) (*backend.Attachment, error)

func (*Attachments) ListAttachments

func (b *Attachments) ListAttachments(user, msgId string) (atts []*backend.Attachment, err error)

func (*Attachments) ReadAttachment

func (b *Attachments) ReadAttachment(user, id string) (*backend.Attachment, []byte, error)

func (*Attachments) UpdateAttachmentMessage

func (b *Attachments) UpdateAttachmentMessage(user, id, msgId string) error

Additional function needed for imap.Messages backend

type Contacts

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

func (*Contacts) DeleteAllContacts

func (b *Contacts) DeleteAllContacts(user string) error

func (*Contacts) DeleteContact

func (b *Contacts) DeleteContact(user, id string) error

func (*Contacts) InsertContact

func (b *Contacts) InsertContact(user string, contact *backend.Contact) (*backend.Contact, error)

func (*Contacts) ListContacts

func (b *Contacts) ListContacts(user string) (contacts []*backend.Contact, err error)

func (*Contacts) UpdateContact

func (b *Contacts) UpdateContact(user string, update *backend.ContactUpdate) (*backend.Contact, error)

type Conversations

type Conversations struct {
	*Messages
}

func (*Conversations) CountConversations

func (b *Conversations) CountConversations(user string) (counts []*backend.MessagesCount, err error)

func (*Conversations) DeleteConversation

func (b *Conversations) DeleteConversation(user, id string) (err error)

func (*Conversations) GetConversation

func (b *Conversations) GetConversation(user, id string) (conv *backend.Conversation, err error)

func (*Conversations) InsertMessage

func (b *Conversations) InsertMessage(user string, msg *backend.Message) (*backend.Message, error)

func (*Conversations) ListConversationMessages

func (b *Conversations) ListConversationMessages(user, id string) (msgs []*backend.Message, err error)

func (*Conversations) ListConversations

func (b *Conversations) ListConversations(user string, filter *backend.MessagesFilter) (convs []*backend.Conversation, total int, err error)

type Domains

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

func (*Domains) GetDomain

func (b *Domains) GetDomain(id string) (*backend.Domain, error)

func (*Domains) GetDomainByName

func (b *Domains) GetDomainByName(name string) (*backend.Domain, error)

func (*Domains) InsertDomain

func (b *Domains) InsertDomain(domain *backend.Domain) (*backend.Domain, error)

func (*Domains) ListDomains

func (b *Domains) ListDomains() (domains []*backend.Domain, err error)

type Events

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

func (*Events) DeleteAllEvents

func (b *Events) DeleteAllEvents(user string) error

func (*Events) GetEventsAfter

func (b *Events) GetEventsAfter(user, id string) (*backend.Event, error)

func (*Events) GetLastEvent

func (b *Events) GetLastEvent(user string) (*backend.Event, error)

func (*Events) InsertEvent

func (b *Events) InsertEvent(user string, e *backend.Event) error

type Keys

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

func (*Keys) GetKeypair

func (b *Keys) GetKeypair(email string) (*backend.Keypair, error)

func (*Keys) GetPublicKey

func (b *Keys) GetPublicKey(email string) (string, error)

func (*Keys) InsertKeypair

func (b *Keys) InsertKeypair(email string, keypair *backend.Keypair) (inserted *backend.Keypair, err error)

func (*Keys) UpdateKeypair

func (b *Keys) UpdateKeypair(email string, keypair *backend.Keypair) (updated *backend.Keypair, err error)

type Labels

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

func (*Labels) DeleteLabel

func (b *Labels) DeleteLabel(user, id string) error

func (*Labels) InsertLabel

func (b *Labels) InsertLabel(user string, label *backend.Label) (*backend.Label, error)

func (*Labels) ListLabels

func (b *Labels) ListLabels(user string) (labels []*backend.Label, err error)

func (*Labels) UpdateLabel

func (b *Labels) UpdateLabel(user string, update *backend.LabelUpdate) (*backend.Label, error)

type Messages

type Messages struct {
	*Attachments
	// contains filtered or unexported fields
}

func (*Messages) CountMessages

func (b *Messages) CountMessages(user string) (counts []*backend.MessagesCount, err error)

func (*Messages) DeleteMessage

func (b *Messages) DeleteMessage(user, id string) error

func (*Messages) GetMessage

func (b *Messages) GetMessage(user, id string) (msg *backend.Message, err error)

func (*Messages) InsertMessage

func (b *Messages) InsertMessage(user string, msg *backend.Message) (*backend.Message, error)

func (*Messages) ListMessages

func (b *Messages) ListMessages(user string, filter *backend.MessagesFilter) (msgs []*backend.Message, total int, err error)

func (*Messages) UpdateMessage

func (b *Messages) UpdateMessage(user string, update *backend.MessageUpdate) (msg *backend.Message, err error)

type Users

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

func NewUsers

func NewUsers() *Users

func (*Users) Auth

func (b *Users) Auth(username, password string) (user *backend.User, err error)

func (*Users) GetUser

func (b *Users) GetUser(id string) (user *backend.User, err error)

func (*Users) InsertUser

func (b *Users) InsertUser(u *backend.User, password string) (*backend.User, error)

func (*Users) IsUsernameAvailable

func (b *Users) IsUsernameAvailable(username string) (bool, error)

func (*Users) UpdateUser

func (b *Users) UpdateUser(update *backend.UserUpdate) error

func (*Users) UpdateUserPassword

func (b *Users) UpdateUserPassword(id, current, new string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto