todo

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

README

todo

To get the package

go get github.com/slashformotion/todo/pkg/todo

Documentation

Index

Constants

View Source
const DefaultExtension string = ".todo"

Variables

This section is empty.

Functions

func CheckTodoFileName

func CheckTodoFileName(path string) error

func FinishedCharacters

func FinishedCharacters() []string

CONSTANT: Return the caracter signaling that the task is done

Explaination here => https://qvault.io/golang/golang-constant-maps-slices/

func MarkTaskAsFinished

func MarkTaskAsFinished(task *Task) error

Mark the task as Finished

func MarkTaskAsUnfinished

func MarkTaskAsUnfinished(task *Task) error

Mark the task as Unfinished

func UnfinishedCharacters

func UnfinishedCharacters() []string

CONSTANT: Return the caracter signaling that the task is not done

Explaination here => https://qvault.io/golang/golang-constant-maps-slices/

Types

type Task

type Task struct {
	Name string
	// contains filtered or unexported fields
}

Task represents a Task in .todo files 'Name' is the name of the task 'Finished' is self-explainatory

func NewTask

func NewTask(name string, done bool) (*Task, error)

Create a new Task with a name and a state of completion (boolean)

func Parse

func Parse(s string) (tasks []*Task, err error)

func ProcessMatch

func ProcessMatch(match []string) (*Task, error)

func (*Task) Finished

func (t *Task) Finished()

Mark the task as Finished

func (*Task) IsFinished

func (t *Task) IsFinished() bool

return the true is the task is finished

func (*Task) Unfinished

func (t *Task) Unfinished()

Mark the task as Unfinished

type TodoFile

type TodoFile struct {
	Path string
	// contains filtered or unexported fields
}

func NewTodoFile

func NewTodoFile(path string) (*TodoFile, error)

func (*TodoFile) Append

func (t *TodoFile) Append(task *Task)

func (*TodoFile) AppendMultiples

func (t *TodoFile) AppendMultiples(tasks []*Task)

func (*TodoFile) MarkAsCompleted

func (t *TodoFile) MarkAsCompleted(index int) (*Task, error)

func (*TodoFile) MarkAsUncompleted

func (t *TodoFile) MarkAsUncompleted(index int) (*Task, error)

Mark the task at index as uncompleted

func (*TodoFile) RemoveTask

func (t *TodoFile) RemoveTask(index int) (*Task, error)

func (*TodoFile) RenderToFile

func (t *TodoFile) RenderToFile() (res string)

func (*TodoFile) RenderToScreen

func (t *TodoFile) RenderToScreen() (res string)

Jump to

Keyboard shortcuts

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