task

package
v0.0.0-...-8a491d9 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	Created     time.Time `json:"created"`
	Modified    time.Time `json:"modified,omitempty"`
	Completed   time.Time `json:"completed,omitempty"`
	Due         time.Time `json:"due,omitempty"`
	Description string    `json:"description"`
	Status      string    `json:"status"`
	Project     string    `json:"project,omitempty"`
	Tags        []string  `json:"tags,omitempty"`
	VirtualTags []string  `json:"-"`
	Notes       []string  `json:"notes,omitempty"`
	UUID        uuid.UUID `json:"uuid"`
	Urgency     float64   `json:"-"`
	ID          int       `json:"-"`
	// contains filtered or unexported fields
}

A Item is an item

func NewTask

func NewTask(mod *parser.Modification) *Item

NewTask is creating a new task

func (*Item) Age

func (i *Item) Age() string

Age returns age of task in shorthand

func (*Item) Complete

func (i *Item) Complete()

Complete completes task

func (*Item) Delete

func (i *Item) Delete()

Delete deletes task

func (*Item) DueDiff

func (i *Item) DueDiff() string

DueDiff return duration to due date in shorthand

func (*Item) GenerateVirtualTags

func (i *Item) GenerateVirtualTags()

GenerateVirtualTags generates virtual tags of task nolint:gocognit

func (*Item) HasProject

func (i *Item) HasProject() bool

HasProject is a helper if a task has a project

func (*Item) HasTag

func (i *Item) HasTag() bool

HasTag is a helper if a task has a tag

func (*Item) IsPending

func (i *Item) IsPending() bool

IsPending is a helper if a task is pending

func (*Item) LastModifiedDiff

func (i *Item) LastModifiedDiff() string

LastModifiedDiff returns duration since last modification in shorthand

func (*Item) Matches

func (i *Item) Matches(filter *parser.Filter) bool

Matches return if task matches given filter

func (*Item) Modify

func (i *Item) Modify(mod *parser.Modification, modified bool)

Modify modifies task with given modification

func (*Item) SetUrgency

func (i *Item) SetUrgency()

SetUrgency sets urgency of task

type List

type List struct {
	Tasks []*Item
}

List hold n task

func (*List) Add

func (l *List) Add(task *Item) int

Add adds task to list

func (*List) Filter

func (l *List) Filter(filter *parser.Filter)

Filter filters task matching given filter

func (*List) Filtered

func (l *List) Filtered() (tasks []*Item)

Filtered return all filtered task

func (*List) GarbageCollect

func (l *List) GarbageCollect() (completed []*Item)

GarbageCollect moves completed task

func (*List) GetByID

func (l *List) GetByID(id int) *Item

GetByID gets task with id

func (*List) GetByUUID

func (l *List) GetByUUID(uuid uuid.UUID) *Item

GetByUUID gets task with uuid

func (*List) Load

func (l *List) Load(tasks []*Item)

Load adds multiple task to list

func (*List) Set

func (l *List) Set(task *Item)

Set places task at ID

Jump to

Keyboard shortcuts

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