task

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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) *Task

func (*Manager) AddWithNote

func (m *Manager) AddWithNote(description string, priority Priority, noteID string) *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) ListByNote

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

func (*Manager) SetNoteID

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

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 (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"`
	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) HasNote

func (t *Task) HasNote() bool

func (*Task) IsDone

func (t *Task) IsDone() bool

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