task

package
v0.0.0-...-0eb56ef Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2016 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(id string)

Delete removes one task for given ID

func DeleteAll

func DeleteAll()

DeleteAll removes all tasks from db

func NewID

func NewID() (id string)

NewID generates an unique id used for task ID

func RegisterDB

func RegisterDB(database taskStore)

RegisterDB allows to use different task store implementation

Types

type Task

type Task struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	Done bool   `json:"done"`
}

Task struct

func All

func All() (tasks []*Task)

All gets all tasks from store

func Create

func Create(tsk *Task) (createdTask *Task)

Create makes new task

func Get

func Get(id string) (foundTask *Task)

Get returns the task for given ID

func Update

func Update(id string, tsk *Task) (updatedTask *Task)

Update updated given task

Jump to

Keyboard shortcuts

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