store

package
v0.0.0-...-1ae7566 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BookmarkStore

type BookmarkStore struct {
	C *mgo.Collection
}

BookmarkStore provides CRUD operations against the collection "bookmarks".

func (BookmarkStore) Create

func (store BookmarkStore) Create(b *model.Bookmark) error

Create inserts the value of struct Bookmark into collection.

func (BookmarkStore) Delete

func (store BookmarkStore) Delete(id string) error

Delete removes an existing document from the collection.

func (BookmarkStore) GetAll

func (store BookmarkStore) GetAll() []model.Bookmark

GetAll returns all documents from the collection.

func (BookmarkStore) GetByID

func (store BookmarkStore) GetByID(id string) (model.Bookmark, error)

GetByID returns a single document from the collection.

func (BookmarkStore) GetByTag

func (store BookmarkStore) GetByTag(tags []string) []model.Bookmark

GetByTag returns all documents from the collection filtering by tags.

func (BookmarkStore) GetByUser

func (store BookmarkStore) GetByUser(user string) []model.Bookmark

GetByUser returns all documents from the collection.

func (BookmarkStore) Update

func (store BookmarkStore) Update(b model.Bookmark) error

Update modifies an existing document of a collection.

type UserStore

type UserStore struct {
	C *mgo.Collection
}

UserStore provides persistence logic for "users" collection.

func (UserStore) Create

func (store UserStore) Create(user model.User, password string) error

Create insert new User

func (UserStore) Login

func (store UserStore) Login(email, password string) (model.User, error)

Login authenticates the User

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL