task

package
v0.0.0-...-1b98bfd Latest Latest
Warning

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

Go to latest
Published: May 5, 2017 License: Apache-2.0 Imports: 1 Imported by: 3

Documentation

Overview

The package provides a TaskManager implemented using TDD techniques. The tests were developed before the code was written.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Task

type Task struct {
	ID    int64  // Unique identifier
	Title string // Description
	Done  bool   // Is this task done?
}

func NewTask

func NewTask(title string) (*Task, error)

NewTask creates a new task given a title, that can't be empty.

type TaskManager

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

TaskManager manages a list of tasks in memory.

func NewTaskManager

func NewTaskManager() *TaskManager

NewTaskManager returns an empty TaskManager.

func (*TaskManager) All

func (m *TaskManager) All() []*Task

All returns the list of all the Tasks in the TaskManager.

func (*TaskManager) Find

func (m *TaskManager) Find(ID int64) (*Task, bool)

Find returns the Task with the given id in the TaskManager and a boolean indicating if the id was found.

func (*TaskManager) Save

func (m *TaskManager) Save(task *Task) error

Save saves the given Task in the TaskManager.

Jump to

Keyboard shortcuts

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