model

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClockEntry

type ClockEntry struct {
	Start time.Time
	End   *time.Time // nil if currently clocked in
}

ClockEntry represents a single clock entry

type Item

type Item struct {
	Level        int       // Heading level (number of *)
	State        TodoState // TODO, PROG, BLOCK, DONE, or empty
	Priority     Priority  // Priority: A, B, C, or empty
	Title        string    // The main title text
	Tags         []string  // Tags for this item (e.g., :work:urgent:)
	Scheduled    *time.Time
	Deadline     *time.Time
	Closed       *time.Time   // Closed timestamp (when task was marked as done)
	Effort       string       // Effort estimate (e.g., "8h", "2d")
	Notes        []string     // Notes/content under the heading
	Children     []*Item      // Sub-items
	Folded       bool         // Whether the item is folded (hides notes and children)
	ClockEntries []ClockEntry // Clock in/out entries
	SourceFile   string       // Source file path (used in multi-file mode)
}

Item represents a single org-mode item (heading)

func (*Item) ClockIn

func (item *Item) ClockIn() bool

ClockIn starts a new clock entry

func (*Item) ClockOut

func (item *Item) ClockOut() bool

ClockOut ends the current clock entry

func (*Item) CycleState

func (item *Item) CycleState()

CycleState cycles through todo states

func (*Item) GetCurrentClockDuration

func (item *Item) GetCurrentClockDuration() time.Duration

GetCurrentClockDuration returns the duration of the current clock entry

func (*Item) GetTotalClockDuration

func (item *Item) GetTotalClockDuration() time.Duration

GetTotalClockDuration returns the total duration of all clock entries

func (*Item) IsClockedIn

func (item *Item) IsClockedIn() bool

IsClockedIn returns true if there's an active clock entry

func (*Item) ToggleFold

func (item *Item) ToggleFold()

ToggleFold toggles the folded state of an item

type OrgFile

type OrgFile struct {
	Path  string
	Items []*Item
}

OrgFile represents a parsed org-mode file

func (*OrgFile) GetAllItems

func (of *OrgFile) GetAllItems() []*Item

GetAllItems returns a flattened list of all items (for UI display) Respects folding - folded items don't show their children

type Priority

type Priority string

Priority represents org-mode priority levels

const (
	PriorityNone Priority = ""
	PriorityA    Priority = "A"
	PriorityB    Priority = "B"
	PriorityC    Priority = "C"
)

type TodoState

type TodoState string

TodoState represents the state of a todo item

const (
	StateTODO  TodoState = "TODO"
	StatePROG  TodoState = "PROG"
	StateBLOCK TodoState = "BLOCK"
	StateDONE  TodoState = "DONE"
	StateNone  TodoState = ""
)

Jump to

Keyboard shortcuts

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