taskmanager

package
v0.0.0-...-f1e40bb Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Task

type Task struct {
	Id          int    `json:"id"`
	UID         string `json:"uid"`
	Description string `json:"description"`
	Tag         string `json:"tag"`
	Created     string `json:"created"`
	Updated     string `json:"updated"`
	RemindAt    string `json:"remind_at"`
	Completed   string `json:"completed"`
}

Task describes a task object

type Tasks

type Tasks []Task

Tasks represents a list of Task object

func New

func New() Tasks

New return a Task list instance

func (*Tasks) Add

func (t *Tasks) Add(description, tag string, remind string) Task

Add create a new task

func (Tasks) CompletedTask

func (t Tasks) CompletedTask() int

CompletedTask return total completed task count

func (*Tasks) FlushDB

func (t *Tasks) FlushDB() error

FlushDB flush task database

func (Tasks) GetAllTasks

func (t Tasks) GetAllTasks() Tasks

GetAllTasks fetch all tasks

func (Tasks) GetCompletedTasks

func (t Tasks) GetCompletedTasks() Tasks

GetCompletedTasks fetch all completed tasks

func (Tasks) GetLastId

func (t Tasks) GetLastId() int

GetLastId return last inserted id

func (Tasks) GetNextId

func (t Tasks) GetNextId() int

GetNextId return next id

func (Tasks) GetPendingTasks

func (t Tasks) GetPendingTasks() Tasks

GetPendingTasks fetch all pending tasks

func (Tasks) GetReminderTasks

func (t Tasks) GetReminderTasks() Tasks

GetReminderTasks fetch all the reminder tasks

func (Tasks) GetTask

func (t Tasks) GetTask(id int) (Task, error)

GetTask fetch a single task

func (Tasks) Len

func (t Tasks) Len() int

implement the sort interface Len return total length of task list

func (Tasks) Less

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

Less order the task as descending order

func (*Tasks) MarkAsCompleteTask

func (t *Tasks) MarkAsCompleteTask(id int) (Task, error)

MarkAsCompleteTask mark a task as completed by id

func (*Tasks) MarkAsPendingTask

func (t *Tasks) MarkAsPendingTask(id int) (Task, error)

MarkAsPendingTask mark a task as pending by id

func (Tasks) PendingTask

func (t Tasks) PendingTask() int

PendingTask return total pending task count

func (*Tasks) RemoveTask

func (t *Tasks) RemoveTask(id int) error

RemoveTask delete a task by id

func (Tasks) Swap

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

Swap tasks

func (Tasks) TotalTask

func (t Tasks) TotalTask() int

TotalTask return total task count

func (*Tasks) UpdateTask

func (t *Tasks) UpdateTask(id int, description string) (string, error)

UpdateTask update a task by id

func (*Tasks) UpdateTaskTag

func (t *Tasks) UpdateTaskTag(id int, tag string) (string, error)

UpdateTaskTag update a task's tag by id

Jump to

Keyboard shortcuts

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