task

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2017 License: Apache-2.0 Imports: 3 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Day

type Day struct {
	Date  time.Time
	Todos TodoList
}

Day is composition of a date and a TodoList. It is supposed to contain all todos for the given date.

type DayList

type DayList []Day

DayList is a simple list of Days

func (DayList) DayByDate

func (t DayList) DayByDate(date time.Time) Day

DayByDate returns a copy of the day for the given date from the DayList or a newly initialized day for the date if the list does not contain it yet

func (*DayList) DeleteDay

func (t *DayList) DeleteDay(date time.Time)

func (DayList) HasDate

func (t DayList) HasDate(date time.Time) bool

HasDate returns true if the DayList contains a date with the given date

func (DayList) Len

func (t DayList) Len() int

func (DayList) Less

func (t DayList) Less(i, j int) bool

func (*DayList) SetDay

func (t *DayList) SetDay(day Day)

SetDay inserts a given day into the DayList. If the day is already in the list it is overwritten otherwise it is simply appended

func (DayList) Swap

func (t DayList) Swap(i, j int)

type Todo

type Todo struct {
	Description string
	Complete    bool
}

Todo is the base type for all tasks we want to save

func (Todo) String

func (t Todo) String() string

type TodoList

type TodoList []Todo

TodoList is a simple list of Todos

func (*TodoList) Insert

func (t *TodoList) Insert(tl TodoList)

Insert inserts all Todos from the parameter TodoList into the list on which the method is called

func (*TodoList) InsertTodo

func (t *TodoList) InsertTodo(td Todo)

InsertTodo checks if a Todo is already in the todo list and if not adds it In case the Todo is already in the list but has a different Complete Status, the todo will be overwritten

func (TodoList) Len

func (t TodoList) Len() int

func (TodoList) Less

func (t TodoList) Less(i, j int) bool

func (TodoList) Swap

func (t TodoList) Swap(i, j int)

Jump to

Keyboard shortcuts

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