Documentation ¶
Index ¶
- type MongoStorage
- func (b *MongoStorage) Connect() error
- func (b *MongoStorage) DeleteTask(taskID string) error
- func (b *MongoStorage) GetAllTasks() ([]model.Task, error)
- func (b *MongoStorage) GetAllTasksForUser(user string) ([]model.Task, error)
- func (b *MongoStorage) GetTask(taskID string) (model.Task, error)
- func (b *MongoStorage) IsConnected() bool
- func (b *MongoStorage) StoreTask(task model.Task) (primitive.ObjectID, error)
- func (b *MongoStorage) UpdateTask(task model.Task) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MongoStorage ¶
type MongoStorage struct {
// contains filtered or unexported fields
}
MongoStorage is a MongoDB implementation of a storage.
func (*MongoStorage) Connect ¶
func (b *MongoStorage) Connect() error
Connect initializes the MongoStorage by using the appropriate Mongo functions. In addition it checks its collections and creates indices if necessary. This method must be called before the Mongo Backend can be used.
func (*MongoStorage) DeleteTask ¶
func (b *MongoStorage) DeleteTask(taskID string) error
DeleteTask deletes a Task.
func (*MongoStorage) GetAllTasks ¶
func (b *MongoStorage) GetAllTasks() ([]model.Task, error)
GetAllTasks returns all stored tasks.
func (*MongoStorage) GetAllTasksForUser ¶
func (b *MongoStorage) GetAllTasksForUser(user string) ([]model.Task, error)
GetAllTasksForUser returns all stored tasks.
func (*MongoStorage) GetTask ¶
func (b *MongoStorage) GetTask(taskID string) (model.Task, error)
GetTask gets one Task.
func (*MongoStorage) IsConnected ¶
func (b *MongoStorage) IsConnected() bool
IsConnected indicates if there is a connection to a Mongo server
func (*MongoStorage) StoreTask ¶
StoreTask stores a task or updates a task when one with the same id exists.
func (*MongoStorage) UpdateTask ¶
func (b *MongoStorage) UpdateTask(task model.Task) error
UpdateTask updates a Task.
Click to show internal directories.
Click to hide internal directories.