models

package
v0.0.0-...-e2631b5 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindAll

func FindAll(db, collection string, query, selector, result interface{}) error

func Insert

func Insert(db, collection string, docs ...interface{}) error

func InsertTask

func InsertTask(task Task) error

Insert a new Task to DB

func Remove

func Remove(db, collection string, query interface{}) error

func RemoveTask

func RemoveTask(id string) error

del a task

func Update

func Update(db, collection string, query, update interface{}) error

func UpdateTask

func UpdateTask(task Task) error

Update Task info

Types

type Task

type Task struct {
	Id   bson.ObjectId `bson:"_id" json:"id" form:"-"`
	Name string        `bson:"name" json:"name" form:"name"`
	Done bool          `bson:"done" json:"done" form:"done"`
}

task model

func FindAllTasks

func FindAllTasks() ([]Task, error)

Query tasks info

Jump to

Keyboard shortcuts

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