Documentation
¶
Overview ¶
Package model defines the core data types for taskmd tasks.
It provides the Task struct along with typed enums for Status, Priority, Effort, and TaskType. All types support YAML marshaling via gopkg.in/yaml.v3.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateVerifySteps ¶
func ValidateVerifySteps(steps []VerifyStep) []string
ValidateVerifySteps checks that each step has a type and the required fields for that type. Returns a list of human-readable validation errors.
Types ¶
type FlexibleTime ¶
FlexibleTime wraps time.Time with a custom YAML unmarshaler that handles both quoted strings ("2025-01-15") and native YAML dates (2025-01-15).
func NewFlexibleTime ¶
func NewFlexibleTime(t time.Time) FlexibleTime
NewFlexibleTime wraps a time.Time into a FlexibleTime.
func (FlexibleTime) MarshalYAML ¶
func (ft FlexibleTime) MarshalYAML() (any, error)
func (*FlexibleTime) UnmarshalYAML ¶
func (ft *FlexibleTime) UnmarshalYAML(value *yaml.Node) error
type Status ¶
type Status string
Status represents the current state of a task
func (Status) IsResolved ¶
IsResolved returns true if the status represents a terminal state where the task is no longer active (completed or cancelled).
type Task ¶
type Task struct {
// Frontmatter fields
ID string `yaml:"id" json:"id"`
Title string `yaml:"title" json:"title"`
Status Status `yaml:"status" json:"status"`
Priority Priority `yaml:"priority" json:"priority,omitempty"`
Effort Effort `yaml:"effort" json:"effort,omitempty"`
Type TaskType `yaml:"type" json:"type,omitempty"`
Dependencies []string `yaml:"dependencies" json:"dependencies"`
Tags []string `yaml:"tags" json:"tags"`
Touches []string `yaml:"touches" json:"touches,omitempty"`
Context []string `yaml:"context" json:"context,omitempty"`
Group string `yaml:"group" json:"group,omitempty"`
Owner string `yaml:"owner" json:"owner,omitempty"`
Parent string `yaml:"parent,omitempty" json:"parent,omitempty"`
Created FlexibleTime `yaml:"created" json:"created"`
Verify []VerifyStep `yaml:"verify,omitempty" json:"verify,omitempty"`
ExternalID string `yaml:"external_id,omitempty" json:"external_id,omitempty"`
PRs []string `yaml:"pr,omitempty" json:"pr,omitempty"`
// Content fields
Body string `json:"-"`
FilePath string `json:"file_path"`
// Worklog metadata (populated on demand, not from frontmatter)
WorklogEntries int `json:"worklog_entries,omitempty" yaml:"-"`
WorklogUpdated *time.Time `json:"worklog_updated,omitempty" yaml:"-"`
}
Task represents a parsed task from a markdown file
type VerifyStep ¶
type VerifyStep struct {
Type string `yaml:"type" json:"type"`
Run string `yaml:"run,omitempty" json:"run,omitempty"`
Dir string `yaml:"dir,omitempty" json:"dir,omitempty"`
Check string `yaml:"check,omitempty" json:"check,omitempty"`
}
VerifyStep represents a single verification check defined in task frontmatter.