models

package
v0.0.0-...-66b2585 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2014 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectToDatabase

func ConnectToDatabase()

Types

type Database

type Database struct {
	Tasks TaskCollection
}

func DatabaseInstance

func DatabaseInstance(userId string) *Database

type Task

type Task struct {
	Id        bson.ObjectId `json:"id"           bson:"_id"`
	Title     string        `json:"title"        bson:"title"`
	Dates     []int         `json:"dates"        bson:"dates"`
	Comment   string        `json:"comment"      bson:"comment"`
	Completed bool          `json:"completed"    bson:"completed"`
}

type TaskCollection

type TaskCollection struct {
	// contains filtered or unexported fields
}

func (TaskCollection) Create

func (model TaskCollection) Create(newTask *Task) (err error)

func (TaskCollection) GetAll

func (model TaskCollection) GetAll() (tasks []Task, err error)

func (TaskCollection) Update

func (model TaskCollection) Update(updatedTask *Task) (err error)

Jump to

Keyboard shortcuts

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