models

package
v0.0.0-...-9ae0aeb Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateItem

func CreateItem(message string, userID string) (string, error)

CreateItem func

func DeleteItem

func DeleteItem(itemID string) error

DeleteItem func

Types

type Item

type Item struct {
	Id      bson.ObjectId `bson:"_id,omitempty" json:"id"`
	UserId  string        `bson:"user_id" json:"user_id"`
	Message string        `json:"message"`
}

Item type

func GetUserItems

func GetUserItems(userID string) []Item

GetUserItems func

type ListRepository

type ListRepository struct {
	C *mgo.Collection
}

ListRepository type

func (*ListRepository) Create

func (r *ListRepository) Create(item *Item) (string, error)

Create item

func (*ListRepository) Delete

func (r *ListRepository) Delete(id string) error

Delete item

func (*ListRepository) GetAll

func (r *ListRepository) GetAll(userID string) (items []Item)

GetAll items

Jump to

Keyboard shortcuts

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