Documentation ¶
Index ¶
- type InMemory
- func (memory *InMemory) Count() int
- func (memory *InMemory) DeleteAll() error
- func (memory *InMemory) DeleteOne(id string) error
- func (memory *InMemory) List(start int, limit int) (*data.Messages, error)
- func (memory *InMemory) Load(id string) (*data.Message, error)
- func (memory *InMemory) Search(kind, query string, start, limit int) (*data.Messages, int, error)
- func (memory *InMemory) Store(m *data.Message) (string, error)
- type Maildir
- func (maildir *Maildir) Count() int
- func (maildir *Maildir) DeleteAll() error
- func (maildir *Maildir) DeleteOne(id string) error
- func (maildir *Maildir) List(start, limit int) (*data.Messages, error)
- func (maildir *Maildir) Load(id string) (*data.Message, error)
- func (maildir *Maildir) Search(kind, query string, start, limit int) (*data.Messages, int, error)
- func (maildir *Maildir) Store(m *data.Message) (string, error)
- type MongoDB
- func (mongo *MongoDB) Count() int
- func (mongo *MongoDB) DeleteAll() error
- func (mongo *MongoDB) DeleteOne(id string) error
- func (mongo *MongoDB) List(start int, limit int) (*data.Messages, error)
- func (mongo *MongoDB) Load(id string) (*data.Message, error)
- func (mongo *MongoDB) Search(kind, query string, start, limit int) (*data.Messages, int, error)
- func (mongo *MongoDB) Store(m *data.Message) (string, error)
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InMemory ¶
type InMemory struct { MessageIDIndex map[string]int Messages []*data.Message // contains filtered or unexported fields }
InMemory is an in memory storage backend
func CreateInMemory ¶
func CreateInMemory() *InMemory
CreateInMemory creates a new in memory storage backend
type Maildir ¶
type Maildir struct {
Path string
}
Maildir is a maildir storage backend
func CreateMaildir ¶
CreateMaildir creates a new maildir storage backend
type MongoDB ¶
type MongoDB struct { Client *mongo.Client Collection *mongo.Collection }
MongoDB represents MongoDB backed storage backend
func CreateMongoDB ¶
CreateMongoDB creates a MongoDB backed storage backend
type Storage ¶
type Storage interface { Store(m *data.Message) (string, error) List(start, limit int) (*data.Messages, error) Search(kind, query string, start, limit int) (*data.Messages, int, error) Count() int DeleteOne(id string) error DeleteAll() error Load(id string) (*data.Message, error) }
Storage represents a storage backend
Click to show internal directories.
Click to hide internal directories.