task

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

PriorityCycle is the order of priority cycling in TUI.

Functions

func Run

func Run(manager *Manager) error

Types

type Manager

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

func NewManager

func NewManager(notesDir string) (*Manager, error)

func (*Manager) Add

func (m *Manager) Add(description string, priority Priority, noteID string, dueDate time.Time) *Task

func (*Manager) Delete

func (m *Manager) Delete(id int) error

func (*Manager) Done

func (m *Manager) Done(id int) error

func (*Manager) Get

func (m *Manager) Get(id int) (*Task, error)

func (*Manager) List

func (m *Manager) List(showDone bool) []*Task

func (*Manager) ListByDueDate added in v0.4.0

func (m *Manager) ListByDueDate(showDone bool) []*Task

func (*Manager) ListByNote

func (m *Manager) ListByNote(noteID string) []*Task

func (*Manager) SetDueDate added in v0.4.0

func (m *Manager) SetDueDate(id int, dueDate time.Time) error

func (*Manager) SetNoteID

func (m *Manager) SetNoteID(id int, noteID string) error

func (*Manager) SortByDueDate added in v0.5.0

func (m *Manager) SortByDueDate(tasks []*Task) []*Task

func (*Manager) Toggle

func (m *Manager) Toggle(id int) error

func (*Manager) UnlinkNote

func (m *Manager) UnlinkNote(id int) error

type Model

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

func NewModel

func NewModel(manager *Manager) Model

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Update

func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (Model) View

func (m Model) View() string

type Priority

type Priority int
const (
	PriorityNone Priority = iota
	PriorityLow
	PriorityMedium
	PriorityHigh
)

func CyclePriority added in v0.4.0

func CyclePriority(current Priority, reverse bool) Priority

CyclePriority cycles through priorities in order or reverse.

func ParsePriority added in v0.5.0

func ParsePriority(s string) Priority

ParsePriority parses a string into a Priority value.

func (Priority) String

func (p Priority) String() string

type Status

type Status int
const (
	StatusPending Status = iota
	StatusDone
)

type Task

type Task struct {
	ID          int       `yaml:"id"`
	Description string    `yaml:"description"`
	Priority    Priority  `yaml:"priority"`
	Status      Status    `yaml:"status"`
	NoteID      string    `yaml:"note_id,omitempty"`
	DueDate     time.Time `yaml:"due_date,omitempty"`
	Created     time.Time `yaml:"created"`
	Completed   time.Time `yaml:"completed,omitempty"`
}

func NewTask

func NewTask(id int, description string, priority Priority) *Task

func (*Task) Done

func (t *Task) Done()

func (*Task) HasDueDate added in v0.4.0

func (t *Task) HasDueDate() bool

func (*Task) HasNote

func (t *Task) HasNote() bool

func (*Task) IsDone

func (t *Task) IsDone() bool

func (*Task) IsDueSoon added in v0.4.0

func (t *Task) IsDueSoon(days int) bool

func (*Task) IsOverdue added in v0.4.0

func (t *Task) IsOverdue() bool

func (*Task) SetDueDate added in v0.4.0

func (t *Task) SetDueDate(due time.Time)

func (*Task) SetNoteID

func (t *Task) SetNoteID(noteID string)

Jump to

Keyboard shortcuts

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