Documentation ¶
Index ¶
- type Category
- func (cat *Category) AddImage(db *mgo.Database, u *User, img *Image)
- func (cat *Category) CreateCategory(db *mgo.Database, user *User)
- func (cat *Category) DeleteCategory(db *mgo.Database, user *User) (found bool)
- func (cat *Category) HasImage(db *mgo.Database, img *Image) bool
- func (cat *Category) ReadCategory(db *mgo.Database, user *User) (found bool)
- func (cat *Category) RemoveImage(db *mgo.Database, u *User, img *Image)
- func (cat *Category) UpdateCategory(db *mgo.Database, user *User) (found bool)
- type Image
- type QueryOptions
- type User
- func (user *User) CreateUser(db *mgo.Database)
- func (user *User) GetCategories(db *mgo.Database, options QueryOptions, parentCatID string) []Category
- func (user *User) GetNumCategories(db *mgo.Database, options QueryOptions, parentCatID string) int
- func (user *User) ReadUserByAccountID(db *mgo.Database) (found bool)
- func (user *User) ReadUserByToken(db *mgo.Database) (found bool)
- func (user *User) UpdateUser(db *mgo.Database) (found bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Category ¶
type Category struct { ID bson.ObjectId `json:"id" bson:"_id,omitempty"` UserID bson.ObjectId `json:"userId" bson:"userId"` Name string `json:"name"` ImageIDs []bson.ObjectId `json:"imageIds" bson:"imageIds"` }
Category entity. A category may contain multiple images and an image can belong to multiple categories.
func (*Category) CreateCategory ¶
CreateCategory inserts a category.
func (*Category) DeleteCategory ¶
DeleteCategory deletes a category.
func (*Category) ReadCategory ¶
ReadCategory fetches a category.
func (*Category) RemoveImage ¶
type Image ¶
type QueryOptions ¶
QueryOptions options.
type User ¶
type User struct { ID bson.ObjectId `json:"id" bson:"_id,omitempty"` AccessToken string `json:"accessToken" bson:"accessToken"` AccountID string `json:"accountId" bson:"accountId"` }
User entity. The AccessToken and AccountID properties are provided by the user's Dropbox account.
func (*User) GetCategories ¶
func (user *User) GetCategories(db *mgo.Database, options QueryOptions, parentCatID string) []Category
GetCategories returns a list of categories..
func (*User) GetNumCategories ¶
GetNumCategories returns the number of categories.
func (*User) ReadUserByAccountID ¶
ReadUserByAccountID searches a user by account ID.
func (*User) ReadUserByToken ¶
ReadUserByToken searches a user by access token.
Click to show internal directories.
Click to hide internal directories.