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 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 ¶
InMemory is an in memory storage backend
func CreateInMemory ¶
func CreateInMemory() *InMemory
CreateInMemory creates a new in memory 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(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.