domain

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2026 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsValidTaskStatus added in v0.10.8

func IsValidTaskStatus(status TaskStatus) bool

IsValidTaskStatus returns true if the status is a valid canonical status value.

Types

type CheckboxItem

type CheckboxItem struct {
	Line       int
	Checked    bool
	InProgress bool
	Text       string
	RawLine    string
}

CheckboxItem represents a checkbox item in markdown content.

type Goal

type Goal struct {
	// Frontmatter fields
	Status     GoalStatus `yaml:"status"`
	PageType   string     `yaml:"page_type"`
	Theme      string     `yaml:"theme,omitempty"`
	Priority   Priority   `yaml:"priority,omitempty"`
	Assignee   string     `yaml:"assignee,omitempty"`
	StartDate  *time.Time `yaml:"start_date,omitempty"`
	TargetDate *time.Time `yaml:"target_date,omitempty"`
	Tags       []string   `yaml:"tags,omitempty"`

	// Metadata
	Name     string         `yaml:"-"` // Filename without extension
	Content  string         `yaml:"-"` // Full markdown content including frontmatter
	FilePath string         `yaml:"-"` // Absolute path to file
	Tasks    []CheckboxItem `yaml:"-"` // Parsed checkbox tasks from content
}

Goal represents a goal in the Obsidian vault with YAML frontmatter.

type GoalID

type GoalID string

GoalID represents a goal identifier (filename without .md extension).

func (GoalID) String

func (g GoalID) String() string

type GoalStatus

type GoalStatus string

GoalStatus represents the status of a goal.

const (
	GoalStatusActive    GoalStatus = "active"
	GoalStatusCompleted GoalStatus = "completed"
	GoalStatusOnHold    GoalStatus = "on_hold"
)

type Priority added in v0.4.0

type Priority int

Priority represents a task priority value. Valid values are integers >= 0, or -1 for invalid/unparseable values.

func (*Priority) UnmarshalYAML added in v0.4.0

func (p *Priority) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML implements custom YAML unmarshaling for Priority. If the value is a valid int, use it. Otherwise, set to -1 (invalid). This makes priority parsing non-fatal - files with string priority values won't cause YAML unmarshal to fail.

type RecurringInterval added in v0.12.0

type RecurringInterval struct {
	Years  int
	Months int
	Days   int
}

RecurringInterval represents a time interval for recurring tasks.

func ParseRecurringInterval added in v0.12.0

func ParseRecurringInterval(s string) (RecurringInterval, error)

ParseRecurringInterval parses a recurring interval string into a RecurringInterval. Named aliases: daily, weekly, monthly, quarterly, yearly. Numeric shorthand: <N><unit> where unit is d, w, m, q, or y. Note: "weekdays" is NOT handled here — check for it before calling this function.

func (RecurringInterval) AddTo added in v0.12.0

func (r RecurringInterval) AddTo(t time.Time) time.Time

AddTo adds the interval to the given time and returns the result.

type Task

type Task struct {
	// Frontmatter fields
	Status          TaskStatus    `yaml:"status"`
	PageType        string        `yaml:"page_type"`
	Goals           []string      `yaml:"goals,omitempty"`
	Priority        Priority      `yaml:"priority,omitempty"`
	Assignee        string        `yaml:"assignee,omitempty"`
	DeferDate       *libtime.Date `yaml:"defer_date,omitempty"`
	Tags            []string      `yaml:"tags,omitempty"`
	Phase           string        `yaml:"phase,omitempty"`
	ClaudeSessionID string        `yaml:"claude_session_id,omitempty"`
	Recurring       string        `yaml:"recurring,omitempty"`
	LastCompleted   string        `yaml:"last_completed,omitempty"`
	PlannedDate     *libtime.Date `yaml:"planned_date,omitempty"`

	// Metadata
	Name     string `yaml:"-"` // Filename without extension
	Content  string `yaml:"-"` // Full markdown content including frontmatter
	FilePath string `yaml:"-"` // Absolute path to file
}

Task represents a task in the Obsidian vault with YAML frontmatter.

type TaskID

type TaskID string

TaskID represents a task identifier (filename without .md extension).

func (TaskID) String

func (t TaskID) String() string

type TaskStatus

type TaskStatus string

TaskStatus represents the status of a task.

const (
	TaskStatusTodo       TaskStatus = "todo"
	TaskStatusInProgress TaskStatus = "in_progress"
	TaskStatusBacklog    TaskStatus = "backlog"
	TaskStatusCompleted  TaskStatus = "completed"
	TaskStatusHold       TaskStatus = "hold"
	TaskStatusAborted    TaskStatus = "aborted"
)

func NormalizeTaskStatus added in v0.10.8

func NormalizeTaskStatus(raw string) (TaskStatus, bool)

NormalizeTaskStatus converts alias status values to their canonical form. Returns the canonical status and true if valid, or empty and false if unknown.

func (*TaskStatus) UnmarshalYAML added in v0.10.8

func (s *TaskStatus) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements custom YAML unmarshaling that normalizes status values.

type Theme

type Theme struct {
	// Frontmatter fields
	Status     ThemeStatus `yaml:"status"`
	PageType   string      `yaml:"page_type"`
	Priority   Priority    `yaml:"priority,omitempty"`
	Assignee   string      `yaml:"assignee,omitempty"`
	StartDate  *time.Time  `yaml:"start_date,omitempty"`
	TargetDate *time.Time  `yaml:"target_date,omitempty"`
	Tags       []string    `yaml:"tags,omitempty"`

	// Metadata
	Name     string `yaml:"-"` // Filename without extension
	Content  string `yaml:"-"` // Full markdown content including frontmatter
	FilePath string `yaml:"-"` // Absolute path to file
}

Theme represents a theme in the Obsidian vault with YAML frontmatter.

type ThemeID

type ThemeID string

ThemeID represents a theme identifier (filename without .md extension).

func (ThemeID) String

func (t ThemeID) String() string

type ThemeStatus

type ThemeStatus string

ThemeStatus represents the status of a theme.

const (
	ThemeStatusActive    ThemeStatus = "active"
	ThemeStatusCompleted ThemeStatus = "completed"
	ThemeStatusArchived  ThemeStatus = "archived"
)

Jump to

Keyboard shortcuts

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