Documentation ¶
Index ¶
- type InMemory
- func (memory *InMemory) Count(room string) int
- func (memory *InMemory) DeleteAll(room string) error
- func (memory *InMemory) DeleteOne(room string, id string) error
- func (memory *InMemory) List(room string, start int, limit int) (*data.Messages, error)
- func (memory *InMemory) Load(room string, id string) (*data.Message, error)
- func (memory *InMemory) Search(room string, kind, query string, start, limit int) (*data.Messages, int, error)
- func (memory *InMemory) Store(room string, m *data.Message) (string, error)
- type Maildir
- func (maildir *Maildir) Count(room string) int
- func (maildir *Maildir) DeleteAll(room string) error
- func (maildir *Maildir) DeleteOne(room string, id string) error
- func (maildir *Maildir) List(room string, start, limit int) (*data.Messages, error)
- func (maildir *Maildir) Load(room string, id string) (*data.Message, error)
- func (maildir *Maildir) Search(room string, kind, query string, start, limit int) (*data.Messages, int, error)
- func (maildir *Maildir) Store(room string, m *data.Message) (string, error)
- type MongoDB
- func (mongo *MongoDB) Count(room string) int
- func (mongo *MongoDB) DeleteAll(room string) error
- func (mongo *MongoDB) DeleteOne(room string, id string) error
- func (mongo *MongoDB) List(room string, start int, limit int) (*data.Messages, error)
- func (mongo *MongoDB) Load(room string, id string) (*data.Message, error)
- func (mongo *MongoDB) Search(room string, kind, query string, start, limit int) (*data.Messages, int, error)
- func (mongo *MongoDB) Store(room string, 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 MessagesLimit int // 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 ¶
Maildir is a maildir storage backend
func CreateMaildir ¶
CreateMaildir creates a new maildir storage backend
type MongoDB ¶
type MongoDB struct { Session *mgo.Session Collection *mgo.Collection }
MongoDB represents MongoDB backed storage backend
func CreateMongoDB ¶
CreateMongoDB creates a MongoDB backed storage backend
type Storage ¶
type Storage interface { Store(room string, m *data.Message) (string, error) List(room string, start, limit int) (*data.Messages, error) Search(room string, kind, query string, start, limit int) (*data.Messages, int, error) Count(room string) int DeleteOne(room string, id string) error DeleteAll(room string) error Load(room string, id string) (*data.Message, error) }
Storage represents a storage backend
Click to show internal directories.
Click to hide internal directories.