domain

package
v0.58.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: BSD-2-Clause Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

AvailableGoalStatuses lists all valid canonical goal status values.

AvailableObjectiveStatuses lists all valid canonical objective status values.

AvailableTaskPhases lists all valid canonical task phase values.

AvailableTaskStatuses lists all valid canonical task status values.

AvailableThemeStatuses lists all valid canonical theme status values.

AvailableVisionStatuses lists all valid canonical vision status values.

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 Content added in v0.53.0

type Content string

Content is the full markdown file content including the frontmatter block. It is embedded in entity structs (Task, Goal, Theme, Objective, Vision) alongside FileMetadata and an entity-specific XxxFrontmatter type. The storage layer extracts the markdown body from Content on write.

func (Content) String added in v0.53.0

func (c Content) String() string

String returns the underlying string value.

type DateOrDateTime added in v0.41.0

type DateOrDateTime time.Time

DateOrDateTime wraps time.Time and serializes as YYYY-MM-DD for pure date values (midnight UTC) and RFC3339 for datetime values with a time component.

func (DateOrDateTime) Before added in v0.41.0

func (d DateOrDateTime) Before(other time.Time) bool

Before reports whether d is before other.

func (DateOrDateTime) Format added in v0.41.0

func (d DateOrDateTime) Format(layout string) string

Format returns a textual representation of d using the given layout.

func (DateOrDateTime) IsZero added in v0.41.0

func (d DateOrDateTime) IsZero() bool

IsZero reports whether d represents the zero time instant.

func (DateOrDateTime) MarshalText added in v0.41.0

func (d DateOrDateTime) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler. Values with zero hour/minute/second/nanosecond in UTC serialize as YYYY-MM-DD; all others serialize as RFC3339.

func (DateOrDateTime) Ptr added in v0.41.0

func (d DateOrDateTime) Ptr() *DateOrDateTime

Ptr returns a pointer to a copy of d.

func (DateOrDateTime) Time added in v0.41.0

func (d DateOrDateTime) Time() time.Time

Time returns the underlying time.Time value.

func (*DateOrDateTime) UnmarshalText added in v0.41.0

func (d *DateOrDateTime) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler. Accepts YYYY-MM-DD and RFC3339 formats (delegated to libtime.ParseTime).

type Decision added in v0.21.0

type Decision struct {
	// Frontmatter fields
	NeedsReview  bool   `yaml:"needs_review"`
	Reviewed     bool   `yaml:"reviewed,omitempty"`
	ReviewedDate string `yaml:"reviewed_date,omitempty"`
	Status       string `yaml:"status,omitempty"`
	Type         string `yaml:"type,omitempty"`
	PageType     string `yaml:"page_type,omitempty"`

	// Metadata — excluded from YAML serialization
	Name     string `yaml:"-"` // Relative path from vault root without .md extension
	Content  string `yaml:"-"` // Full markdown content including frontmatter
	FilePath string `yaml:"-"` // Absolute path to file
}

Decision represents a markdown file in the vault that has needs_review frontmatter.

type DecisionID added in v0.21.0

type DecisionID string

DecisionID represents a decision identifier (relative vault path without .md extension).

func (DecisionID) String added in v0.21.0

func (d DecisionID) String() string

type FileMetadata added in v0.53.0

type FileMetadata struct {
	// Name is the filename without the .md extension.
	Name string
	// FilePath is the absolute path to the markdown file.
	FilePath string
	// ModifiedDate is the file's last-modified time (UTC), populated by the storage layer.
	ModifiedDate *time.Time
}

FileMetadata holds the filesystem metadata for an entity file. It is embedded in all entity structs (Task, Goal, Theme, Objective, Vision) and is never stored in YAML frontmatter.

type FrontmatterMap added in v0.53.0

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

FrontmatterMap is a typed wrapper around map[string]any that stores YAML frontmatter fields. It preserves all fields, including unknown ones, through read-write cycles. Entity-specific types embed FrontmatterMap and layer typed accessors on top.

func NewFrontmatterMap added in v0.53.0

func NewFrontmatterMap(data map[string]any) FrontmatterMap

NewFrontmatterMap constructs a FrontmatterMap from a raw map. If data is nil, an empty map is used.

func (*FrontmatterMap) Delete added in v0.53.0

func (f *FrontmatterMap) Delete(key string)

Delete removes key from the map. No-op if key is absent.

func (FrontmatterMap) Get added in v0.53.0

func (f FrontmatterMap) Get(key string) any

Get returns the raw value stored for key, or nil if absent.

func (FrontmatterMap) GetString added in v0.53.0

func (f FrontmatterMap) GetString(key string) string

GetString returns the string representation of the value stored for key. Returns "" if the key is absent or the value cannot be stringified.

func (FrontmatterMap) GetStringSlice added in v0.53.0

func (f FrontmatterMap) GetStringSlice(key string) []string

GetStringSlice returns a []string for the value stored under key. Handles: nil (returns nil), []any (coerces each element to string), []string (returned directly), and string (splits on comma).

func (FrontmatterMap) GetTime added in v0.55.2

func (f FrontmatterMap) GetTime(key string) *time.Time

GetTime returns the time.Time value stored for key. Handles three shapes:

  • time.Time (YAML parses date/datetime literals into this automatically)
  • string (falls back to libtime.ParseTime for manually-authored values)
  • anything else → nil

Returns nil on missing key, empty string, parse failure, or unsupported type.

func (FrontmatterMap) Keys added in v0.53.0

func (f FrontmatterMap) Keys() []string

Keys returns all keys present in the map, in no guaranteed order.

func (FrontmatterMap) RawMap added in v0.53.0

func (f FrontmatterMap) RawMap() map[string]any

RawMap returns the underlying map. Callers must not mutate the returned map. This method is intended for serialization (yaml.Marshal).

func (*FrontmatterMap) Set added in v0.53.0

func (f *FrontmatterMap) Set(key string, value any)

Set stores value under key. A nil value is equivalent to Delete.

type Goal

type Goal struct {
	GoalFrontmatter
	FileMetadata
	// Content is the full markdown content including the frontmatter block.
	Content Content

	// Tasks holds checkbox items parsed from content.
	// It is populated by the storage layer and is NOT stored in frontmatter.
	Tasks []CheckboxItem
}

Goal represents a goal in the Obsidian vault. Frontmatter is stored in GoalFrontmatter (a typed map wrapper that preserves unknown fields). Filesystem metadata is in the embedded FileMetadata.

func NewGoal added in v0.55.0

func NewGoal(data map[string]any, meta FileMetadata, content Content) *Goal

NewGoal creates a Goal from a parsed frontmatter map and metadata.

type GoalFrontmatter added in v0.55.0

type GoalFrontmatter struct {
	FrontmatterMap
}

GoalFrontmatter holds the YAML frontmatter for a Goal. It uses FrontmatterMap as its backing store so unknown fields survive round-trips.

func NewGoalFrontmatter added in v0.55.0

func NewGoalFrontmatter(data map[string]any) GoalFrontmatter

NewGoalFrontmatter constructs a GoalFrontmatter from a raw map.

func (GoalFrontmatter) Assignee added in v0.55.0

func (f GoalFrontmatter) Assignee() string

Assignee reads "assignee" key.

func (*GoalFrontmatter) ClearField added in v0.55.0

func (f *GoalFrontmatter) ClearField(key string)

ClearField removes a frontmatter field by key.

func (GoalFrontmatter) Completed added in v0.55.0

func (f GoalFrontmatter) Completed() *libtime.Date

Completed reads "completed" key as *libtime.Date.

func (GoalFrontmatter) DeferDate added in v0.55.0

func (f GoalFrontmatter) DeferDate() *DateOrDateTime

DeferDate reads "defer_date" key as *DateOrDateTime.

func (GoalFrontmatter) GetField added in v0.55.0

func (f GoalFrontmatter) GetField(key string) string

GetField returns the string representation of any frontmatter field by key.

func (GoalFrontmatter) PageType added in v0.55.0

func (f GoalFrontmatter) PageType() string

PageType reads "page_type" key.

func (GoalFrontmatter) Priority added in v0.55.0

func (f GoalFrontmatter) Priority() Priority

Priority reads "priority" key as int.

func (*GoalFrontmatter) SetAssignee added in v0.55.0

func (f *GoalFrontmatter) SetAssignee(v string)

SetAssignee stores the assignee in the map.

func (*GoalFrontmatter) SetCompleted added in v0.55.0

func (f *GoalFrontmatter) SetCompleted(d *libtime.Date)

SetCompleted stores the completed date in the map. Deletes key if d is nil.

func (*GoalFrontmatter) SetDeferDate added in v0.55.0

func (f *GoalFrontmatter) SetDeferDate(d *DateOrDateTime)

SetDeferDate stores the defer_date in the map. Deletes key if d is nil.

func (*GoalFrontmatter) SetField added in v0.55.0

func (f *GoalFrontmatter) SetField(ctx context.Context, key, value string) error

SetField sets a frontmatter field by key from a string value.

func (*GoalFrontmatter) SetPageType added in v0.55.0

func (f *GoalFrontmatter) SetPageType(v string)

SetPageType stores the page_type in the map.

func (*GoalFrontmatter) SetPriority added in v0.55.0

func (f *GoalFrontmatter) SetPriority(ctx context.Context, p Priority) error

SetPriority validates the priority and stores it in the map.

func (*GoalFrontmatter) SetStartDate added in v0.55.0

func (f *GoalFrontmatter) SetStartDate(t *time.Time)

SetStartDate stores the start_date in the map. Deletes key if t is nil.

func (*GoalFrontmatter) SetStatus added in v0.55.0

func (f *GoalFrontmatter) SetStatus(s GoalStatus) error

SetStatus validates and stores the status in the map.

func (*GoalFrontmatter) SetTags added in v0.55.0

func (f *GoalFrontmatter) SetTags(v []string)

SetTags stores tags in the map. Deletes key if v is nil or empty.

func (*GoalFrontmatter) SetTargetDate added in v0.55.0

func (f *GoalFrontmatter) SetTargetDate(t *time.Time)

SetTargetDate stores the target_date in the map. Deletes key if t is nil.

func (*GoalFrontmatter) SetTheme added in v0.55.0

func (f *GoalFrontmatter) SetTheme(v string)

SetTheme stores the theme in the map.

func (GoalFrontmatter) StartDate added in v0.55.0

func (f GoalFrontmatter) StartDate() *time.Time

StartDate reads "start_date" key as *time.Time.

func (GoalFrontmatter) Status added in v0.55.0

func (f GoalFrontmatter) Status() GoalStatus

Status reads "status" key.

func (GoalFrontmatter) Tags added in v0.55.0

func (f GoalFrontmatter) Tags() []string

Tags reads "tags" key via GetStringSlice.

func (GoalFrontmatter) TargetDate added in v0.55.0

func (f GoalFrontmatter) TargetDate() *time.Time

TargetDate reads "target_date" key as *time.Time.

func (GoalFrontmatter) Theme added in v0.55.0

func (f GoalFrontmatter) Theme() string

Theme reads "theme" key.

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"
)

func (GoalStatus) Validate added in v0.55.0

func (s GoalStatus) Validate(ctx context.Context) error

Validate returns an error if the status is not a valid canonical value.

type GoalStatuses added in v0.55.0

type GoalStatuses []GoalStatus

GoalStatuses is a collection of GoalStatus values.

func (GoalStatuses) Contains added in v0.55.0

func (g GoalStatuses) Contains(status GoalStatus) bool

Contains returns true if the collection contains the given status.

type Objective added in v0.29.0

type Objective struct {
	ObjectiveFrontmatter
	FileMetadata
	// Content is the full markdown content including the frontmatter block.
	Content Content
}

Objective represents an objective in the Obsidian vault. Frontmatter is stored in ObjectiveFrontmatter (a typed map wrapper that preserves unknown fields). Filesystem metadata is in the embedded FileMetadata.

func NewObjective added in v0.55.0

func NewObjective(data map[string]any, meta FileMetadata, content Content) *Objective

NewObjective creates an Objective from a parsed frontmatter map and metadata.

type ObjectiveFrontmatter added in v0.55.0

type ObjectiveFrontmatter struct {
	FrontmatterMap
}

ObjectiveFrontmatter holds the YAML frontmatter for an Objective. It uses FrontmatterMap as its backing store so unknown fields survive round-trips.

func NewObjectiveFrontmatter added in v0.55.0

func NewObjectiveFrontmatter(data map[string]any) ObjectiveFrontmatter

NewObjectiveFrontmatter constructs an ObjectiveFrontmatter from a raw map.

func (ObjectiveFrontmatter) Assignee added in v0.55.0

func (f ObjectiveFrontmatter) Assignee() string

Assignee reads "assignee" key.

func (*ObjectiveFrontmatter) ClearField added in v0.55.0

func (f *ObjectiveFrontmatter) ClearField(key string)

ClearField removes a frontmatter field by key.

func (ObjectiveFrontmatter) Completed added in v0.55.0

func (f ObjectiveFrontmatter) Completed() *libtime.Date

Completed reads "completed" key as *libtime.Date.

func (ObjectiveFrontmatter) GetField added in v0.55.0

func (f ObjectiveFrontmatter) GetField(key string) string

GetField returns the string representation of any frontmatter field by key.

func (ObjectiveFrontmatter) PageType added in v0.55.0

func (f ObjectiveFrontmatter) PageType() string

PageType reads "page_type" key.

func (ObjectiveFrontmatter) Priority added in v0.55.0

func (f ObjectiveFrontmatter) Priority() Priority

Priority reads "priority" key as int.

func (*ObjectiveFrontmatter) SetAssignee added in v0.55.0

func (f *ObjectiveFrontmatter) SetAssignee(v string)

SetAssignee stores the assignee in the map.

func (*ObjectiveFrontmatter) SetCompleted added in v0.55.0

func (f *ObjectiveFrontmatter) SetCompleted(d *libtime.Date)

SetCompleted stores the completed date in the map. Deletes key if d is nil.

func (*ObjectiveFrontmatter) SetField added in v0.55.0

func (f *ObjectiveFrontmatter) SetField(ctx context.Context, key, value string) error

SetField sets a frontmatter field by key from a string value.

func (*ObjectiveFrontmatter) SetPageType added in v0.55.0

func (f *ObjectiveFrontmatter) SetPageType(v string)

SetPageType stores the page_type in the map.

func (*ObjectiveFrontmatter) SetPriority added in v0.55.0

func (f *ObjectiveFrontmatter) SetPriority(ctx context.Context, p Priority) error

SetPriority validates the priority and stores it in the map.

func (*ObjectiveFrontmatter) SetStartDate added in v0.55.0

func (f *ObjectiveFrontmatter) SetStartDate(t *time.Time)

SetStartDate stores the start_date in the map. Deletes key if t is nil.

func (*ObjectiveFrontmatter) SetStatus added in v0.55.0

func (f *ObjectiveFrontmatter) SetStatus(s ObjectiveStatus) error

SetStatus validates and stores the status in the map.

func (*ObjectiveFrontmatter) SetTags added in v0.55.0

func (f *ObjectiveFrontmatter) SetTags(v []string)

SetTags stores tags in the map. Deletes key if v is nil or empty.

func (*ObjectiveFrontmatter) SetTargetDate added in v0.55.0

func (f *ObjectiveFrontmatter) SetTargetDate(t *time.Time)

SetTargetDate stores the target_date in the map. Deletes key if t is nil.

func (ObjectiveFrontmatter) StartDate added in v0.55.0

func (f ObjectiveFrontmatter) StartDate() *time.Time

StartDate reads "start_date" key as *time.Time.

func (ObjectiveFrontmatter) Status added in v0.55.0

Status reads "status" key.

func (ObjectiveFrontmatter) Tags added in v0.55.0

func (f ObjectiveFrontmatter) Tags() []string

Tags reads "tags" key via GetStringSlice.

func (ObjectiveFrontmatter) TargetDate added in v0.55.0

func (f ObjectiveFrontmatter) TargetDate() *time.Time

TargetDate reads "target_date" key as *time.Time.

type ObjectiveID added in v0.29.0

type ObjectiveID string

ObjectiveID represents an objective identifier (filename without .md extension).

func (ObjectiveID) String added in v0.29.0

func (o ObjectiveID) String() string

type ObjectiveStatus added in v0.29.0

type ObjectiveStatus string

ObjectiveStatus represents the status of an objective.

const (
	ObjectiveStatusActive    ObjectiveStatus = "active"
	ObjectiveStatusCompleted ObjectiveStatus = "completed"
	ObjectiveStatusOnHold    ObjectiveStatus = "on_hold"
)

func (ObjectiveStatus) Validate added in v0.55.0

func (s ObjectiveStatus) Validate(ctx context.Context) error

Validate returns an error if the status is not a valid canonical value.

type ObjectiveStatuses added in v0.55.0

type ObjectiveStatuses []ObjectiveStatus

ObjectiveStatuses is a collection of ObjectiveStatus values.

func (ObjectiveStatuses) Contains added in v0.55.0

func (o ObjectiveStatuses) Contains(status ObjectiveStatus) bool

Contains returns true if the collection contains the given status.

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.

func (Priority) Validate added in v0.54.0

func (p Priority) Validate(ctx context.Context) error

Validate returns an error if the priority value is invalid. Valid priorities are non-negative integers (0 and up). The sentinel value -1 (used by UnmarshalYAML for unparseable YAML values) is treated as invalid here because any explicit SetPriority call with a negative value is a user error.

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 {
	TaskFrontmatter
	FileMetadata
	// Content is the full markdown content including the frontmatter block.
	// It is used by the storage layer to extract the markdown body on write.
	Content Content
}

Task represents a task in the Obsidian vault. Frontmatter is stored in TaskFrontmatter (a typed map wrapper that preserves unknown fields). Filesystem metadata is in the embedded FileMetadata.

func NewTask added in v0.54.0

func NewTask(data map[string]any, meta FileMetadata, content Content) *Task

NewTask creates a Task from a parsed frontmatter map and metadata.

type TaskFrontmatter added in v0.54.0

type TaskFrontmatter struct {
	FrontmatterMap
}

TaskFrontmatter holds the YAML frontmatter for a Task. It uses FrontmatterMap as its backing store so unknown fields survive round-trips.

func NewTaskFrontmatter added in v0.54.0

func NewTaskFrontmatter(data map[string]any) TaskFrontmatter

NewTaskFrontmatter constructs a TaskFrontmatter from a raw map.

func (TaskFrontmatter) Assignee added in v0.54.0

func (f TaskFrontmatter) Assignee() string

Assignee reads "assignee" key as string.

func (TaskFrontmatter) ClaudeSessionID added in v0.54.0

func (f TaskFrontmatter) ClaudeSessionID() string

ClaudeSessionID reads "claude_session_id" key as string.

func (*TaskFrontmatter) ClearField added in v0.54.0

func (f *TaskFrontmatter) ClearField(key string)

ClearField removes a frontmatter field by key. Works for both known and unknown fields.

func (TaskFrontmatter) CompletedDate added in v0.54.0

func (f TaskFrontmatter) CompletedDate() string

CompletedDate reads "completed_date" as a formatted date string. Same formatting rules as LastCompleted.

func (TaskFrontmatter) DeferDate added in v0.54.0

func (f TaskFrontmatter) DeferDate() *DateOrDateTime

DeferDate reads "defer_date" key as *DateOrDateTime. Handles both time.Time (YAML-parsed) and string (hand-authored) forms. Returns nil on missing or unparseable value.

func (TaskFrontmatter) DueDate added in v0.54.0

func (f TaskFrontmatter) DueDate() *DateOrDateTime

DueDate reads "due_date" key as *DateOrDateTime. Handles both time.Time (YAML-parsed) and string (hand-authored) forms. Returns nil on missing or unparseable value.

func (TaskFrontmatter) GetField added in v0.54.0

func (f TaskFrontmatter) GetField(key string) string

GetField returns the string representation of any frontmatter field by key. Known fields return formatted values. Unknown fields return the raw string. Returns "" if the key is absent.

func (TaskFrontmatter) Goals added in v0.54.0

func (f TaskFrontmatter) Goals() []string

Goals reads "goals" key via GetStringSlice.

func (TaskFrontmatter) LastCompleted added in v0.54.0

func (f TaskFrontmatter) LastCompleted() string

LastCompleted reads "last_completed" as a formatted date string. Returns "" on missing value. Date-only values (midnight UTC) format as "2006-01-02"; values with a time component format as RFC3339.

func (TaskFrontmatter) PageType added in v0.54.0

func (f TaskFrontmatter) PageType() string

PageType reads "page_type" key, returns string.

func (TaskFrontmatter) Phase added in v0.54.0

func (f TaskFrontmatter) Phase() *TaskPhase

Phase reads "phase" key as string, returns *TaskPhase.

func (TaskFrontmatter) PlannedDate added in v0.54.0

func (f TaskFrontmatter) PlannedDate() *DateOrDateTime

PlannedDate reads "planned_date" key as *DateOrDateTime. Handles both time.Time (YAML-parsed) and string (hand-authored) forms. Returns nil on missing or unparseable value.

func (TaskFrontmatter) Priority added in v0.54.0

func (f TaskFrontmatter) Priority() Priority

Priority reads "priority" key as int. Returns 0 on missing or parse failure.

func (TaskFrontmatter) Recurring added in v0.54.0

func (f TaskFrontmatter) Recurring() string

Recurring reads "recurring" key as string.

func (*TaskFrontmatter) SetAssignee added in v0.54.0

func (f *TaskFrontmatter) SetAssignee(v string)

SetAssignee stores the assignee in the map.

func (*TaskFrontmatter) SetClaudeSessionID added in v0.54.0

func (f *TaskFrontmatter) SetClaudeSessionID(v string)

SetClaudeSessionID stores the claude_session_id in the map.

func (*TaskFrontmatter) SetCompletedDate added in v0.54.0

func (f *TaskFrontmatter) SetCompletedDate(v string)

SetCompletedDate stores the completed_date value in the map.

func (*TaskFrontmatter) SetDeferDate added in v0.54.0

func (f *TaskFrontmatter) SetDeferDate(d *DateOrDateTime)

SetDeferDate stores the defer_date in the map. Deletes the key if d is nil.

func (*TaskFrontmatter) SetDueDate added in v0.54.0

func (f *TaskFrontmatter) SetDueDate(d *DateOrDateTime)

SetDueDate stores the due_date in the map. Deletes the key if d is nil.

func (*TaskFrontmatter) SetField added in v0.54.0

func (f *TaskFrontmatter) SetField(ctx context.Context, key, value string) error

SetField sets a frontmatter field by key from a string value. Known fields apply type coercion and validation; unknown fields are stored as-is.

func (*TaskFrontmatter) SetGoals added in v0.54.0

func (f *TaskFrontmatter) SetGoals(v []string)

SetGoals stores goals in the map. Deletes the key if v is nil or empty.

func (*TaskFrontmatter) SetLastCompleted added in v0.54.0

func (f *TaskFrontmatter) SetLastCompleted(v string)

SetLastCompleted stores the last_completed value in the map.

func (*TaskFrontmatter) SetPageType added in v0.54.0

func (f *TaskFrontmatter) SetPageType(v string)

SetPageType stores the page_type in the map.

func (*TaskFrontmatter) SetPhase added in v0.54.0

func (f *TaskFrontmatter) SetPhase(p *TaskPhase)

SetPhase stores the phase pointer in the map. Deletes the key if p is nil.

func (*TaskFrontmatter) SetPlannedDate added in v0.54.0

func (f *TaskFrontmatter) SetPlannedDate(d *DateOrDateTime)

SetPlannedDate stores the planned_date in the map. Deletes the key if d is nil.

func (*TaskFrontmatter) SetPriority added in v0.54.0

func (f *TaskFrontmatter) SetPriority(ctx context.Context, p Priority) error

SetPriority validates the priority and stores it in the map. Returns an error when the value is negative, per spec AC #6.

func (*TaskFrontmatter) SetRecurring added in v0.54.0

func (f *TaskFrontmatter) SetRecurring(v string)

SetRecurring stores the recurring value in the map.

func (*TaskFrontmatter) SetStatus added in v0.54.0

func (f *TaskFrontmatter) SetStatus(s TaskStatus) error

SetStatus validates and stores the status in the map.

func (*TaskFrontmatter) SetTags added in v0.54.0

func (f *TaskFrontmatter) SetTags(v []string)

SetTags stores tags in the map. Deletes the key if v is nil or empty.

func (*TaskFrontmatter) SetTaskIdentifier added in v0.54.0

func (f *TaskFrontmatter) SetTaskIdentifier(v string)

SetTaskIdentifier stores the task_identifier value in the map.

func (TaskFrontmatter) Status added in v0.54.0

func (f TaskFrontmatter) Status() TaskStatus

Status reads "status" key and applies NormalizeTaskStatus. Returns "" (empty) if value is absent or unrecognized.

func (TaskFrontmatter) Tags added in v0.54.0

func (f TaskFrontmatter) Tags() []string

Tags reads "tags" key via GetStringSlice.

func (TaskFrontmatter) TaskIdentifier added in v0.54.0

func (f TaskFrontmatter) TaskIdentifier() string

TaskIdentifier reads "task_identifier" key as string.

type TaskID

type TaskID string

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

func (TaskID) String

func (t TaskID) String() string

type TaskPhase added in v0.46.0

type TaskPhase string

TaskPhase represents a phase in a task's lifecycle.

const (
	// TaskPhaseTodo means the task is ready to start but needs planning.
	TaskPhaseTodo TaskPhase = "todo"
	// TaskPhasePlanning means the approach is being designed.
	TaskPhasePlanning TaskPhase = "planning"
	// TaskPhaseInProgress means active implementation is underway.
	TaskPhaseInProgress TaskPhase = "in_progress"
	// TaskPhaseAIReview means automated checks are running.
	TaskPhaseAIReview TaskPhase = "ai_review"
	// TaskPhaseHumanReview means manual review is required.
	TaskPhaseHumanReview TaskPhase = "human_review"
	// TaskPhaseDone means the task is ready to close.
	TaskPhaseDone TaskPhase = "done"
)

func (TaskPhase) Ptr added in v0.46.0

func (t TaskPhase) Ptr() *TaskPhase

Ptr returns a pointer to a copy of the phase.

func (TaskPhase) String added in v0.46.0

func (t TaskPhase) String() string

String returns the string representation of the phase.

func (TaskPhase) Validate added in v0.46.0

func (t TaskPhase) Validate(ctx context.Context) error

Validate returns an error if the phase is not a valid canonical value.

type TaskPhases added in v0.46.0

type TaskPhases []TaskPhase

TaskPhases is a collection of TaskPhase values.

func (TaskPhases) Contains added in v0.46.0

func (t TaskPhases) Contains(phase TaskPhase) bool

Contains returns true if the collection contains the given phase.

type TaskStatus

type TaskStatus string

TaskStatus represents the status of a task.

const (
	// TaskStatusTodo means the task is queued for action but not yet started.
	TaskStatusTodo TaskStatus = "todo"
	// TaskStatusInProgress means someone is actively working on the task.
	TaskStatusInProgress TaskStatus = "in_progress"
	// TaskStatusBacklog means the task is potential future work, not yet scheduled.
	TaskStatusBacklog TaskStatus = "backlog"
	// TaskStatusCompleted means the task is finished.
	TaskStatusCompleted TaskStatus = "completed"
	// TaskStatusHold means the task is blocked or paused.
	TaskStatusHold TaskStatus = "hold"
	// TaskStatusAborted means the task was cancelled and will not be completed.
	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) Ptr added in v0.45.1

func (s TaskStatus) Ptr() *TaskStatus

Ptr returns a pointer to a copy of the status.

func (TaskStatus) String added in v0.45.1

func (s TaskStatus) String() string

String returns the string representation of the status.

func (TaskStatus) Validate added in v0.45.1

func (s TaskStatus) Validate(ctx context.Context) error

Validate returns an error if the status is not a valid canonical value.

type TaskStatuses added in v0.45.1

type TaskStatuses []TaskStatus

TaskStatuses is a collection of TaskStatus values.

func (TaskStatuses) Contains added in v0.45.1

func (t TaskStatuses) Contains(status TaskStatus) bool

Contains returns true if the collection contains the given status.

type Theme

type Theme struct {
	ThemeFrontmatter
	FileMetadata
	// Content is the full markdown content including the frontmatter block.
	Content Content
}

Theme represents a theme in the Obsidian vault. Frontmatter is stored in ThemeFrontmatter (a typed map wrapper that preserves unknown fields). Filesystem metadata is in the embedded FileMetadata.

func NewTheme added in v0.55.0

func NewTheme(data map[string]any, meta FileMetadata, content Content) *Theme

NewTheme creates a Theme from a parsed frontmatter map and metadata.

type ThemeFrontmatter added in v0.55.0

type ThemeFrontmatter struct {
	FrontmatterMap
}

ThemeFrontmatter holds the YAML frontmatter for a Theme. It uses FrontmatterMap as its backing store so unknown fields survive round-trips.

func NewThemeFrontmatter added in v0.55.0

func NewThemeFrontmatter(data map[string]any) ThemeFrontmatter

NewThemeFrontmatter constructs a ThemeFrontmatter from a raw map.

func (ThemeFrontmatter) Assignee added in v0.55.0

func (f ThemeFrontmatter) Assignee() string

Assignee reads "assignee" key.

func (*ThemeFrontmatter) ClearField added in v0.55.0

func (f *ThemeFrontmatter) ClearField(key string)

ClearField removes a frontmatter field by key.

func (ThemeFrontmatter) GetField added in v0.55.0

func (f ThemeFrontmatter) GetField(key string) string

GetField returns the string representation of any frontmatter field by key.

func (ThemeFrontmatter) PageType added in v0.55.0

func (f ThemeFrontmatter) PageType() string

PageType reads "page_type" key.

func (ThemeFrontmatter) Priority added in v0.55.0

func (f ThemeFrontmatter) Priority() Priority

Priority reads "priority" key as int.

func (*ThemeFrontmatter) SetAssignee added in v0.55.0

func (f *ThemeFrontmatter) SetAssignee(v string)

SetAssignee stores the assignee in the map.

func (*ThemeFrontmatter) SetField added in v0.55.0

func (f *ThemeFrontmatter) SetField(ctx context.Context, key, value string) error

SetField sets a frontmatter field by key from a string value.

func (*ThemeFrontmatter) SetPageType added in v0.55.0

func (f *ThemeFrontmatter) SetPageType(v string)

SetPageType stores the page_type in the map.

func (*ThemeFrontmatter) SetPriority added in v0.55.0

func (f *ThemeFrontmatter) SetPriority(ctx context.Context, p Priority) error

SetPriority validates the priority and stores it in the map.

func (*ThemeFrontmatter) SetStartDate added in v0.55.0

func (f *ThemeFrontmatter) SetStartDate(t *time.Time)

SetStartDate stores the start_date in the map. Deletes key if t is nil.

func (*ThemeFrontmatter) SetStatus added in v0.55.0

func (f *ThemeFrontmatter) SetStatus(s ThemeStatus) error

SetStatus validates and stores the status in the map.

func (*ThemeFrontmatter) SetTags added in v0.55.0

func (f *ThemeFrontmatter) SetTags(v []string)

SetTags stores tags in the map. Deletes key if v is nil or empty.

func (*ThemeFrontmatter) SetTargetDate added in v0.55.0

func (f *ThemeFrontmatter) SetTargetDate(t *time.Time)

SetTargetDate stores the target_date in the map. Deletes key if t is nil.

func (ThemeFrontmatter) StartDate added in v0.55.0

func (f ThemeFrontmatter) StartDate() *time.Time

StartDate reads "start_date" key as *time.Time.

func (ThemeFrontmatter) Status added in v0.55.0

func (f ThemeFrontmatter) Status() ThemeStatus

Status reads "status" key.

func (ThemeFrontmatter) Tags added in v0.55.0

func (f ThemeFrontmatter) Tags() []string

Tags reads "tags" key via GetStringSlice.

func (ThemeFrontmatter) TargetDate added in v0.55.0

func (f ThemeFrontmatter) TargetDate() *time.Time

TargetDate reads "target_date" key as *time.Time.

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"
)

func (ThemeStatus) Validate added in v0.55.0

func (s ThemeStatus) Validate(ctx context.Context) error

Validate returns an error if the status is not a valid canonical value.

type ThemeStatuses added in v0.55.0

type ThemeStatuses []ThemeStatus

ThemeStatuses is a collection of ThemeStatus values.

func (ThemeStatuses) Contains added in v0.55.0

func (t ThemeStatuses) Contains(status ThemeStatus) bool

Contains returns true if the collection contains the given status.

type Vision added in v0.29.0

type Vision struct {
	VisionFrontmatter
	FileMetadata
	// Content is the full markdown content including the frontmatter block.
	Content Content
}

Vision represents a vision in the Obsidian vault. Frontmatter is stored in VisionFrontmatter (a typed map wrapper that preserves unknown fields). Filesystem metadata is in the embedded FileMetadata.

func NewVision added in v0.55.0

func NewVision(data map[string]any, meta FileMetadata, content Content) *Vision

NewVision creates a Vision from a parsed frontmatter map and metadata.

type VisionFrontmatter added in v0.55.0

type VisionFrontmatter struct {
	FrontmatterMap
}

VisionFrontmatter holds the YAML frontmatter for a Vision. It uses FrontmatterMap as its backing store so unknown fields survive round-trips.

func NewVisionFrontmatter added in v0.55.0

func NewVisionFrontmatter(data map[string]any) VisionFrontmatter

NewVisionFrontmatter constructs a VisionFrontmatter from a raw map.

func (VisionFrontmatter) Assignee added in v0.55.0

func (f VisionFrontmatter) Assignee() string

Assignee reads "assignee" key.

func (*VisionFrontmatter) ClearField added in v0.55.0

func (f *VisionFrontmatter) ClearField(key string)

ClearField removes a frontmatter field by key.

func (VisionFrontmatter) GetField added in v0.55.0

func (f VisionFrontmatter) GetField(key string) string

GetField returns the string representation of any frontmatter field by key.

func (VisionFrontmatter) PageType added in v0.55.0

func (f VisionFrontmatter) PageType() string

PageType reads "page_type" key.

func (VisionFrontmatter) Priority added in v0.55.0

func (f VisionFrontmatter) Priority() Priority

Priority reads "priority" key as int.

func (*VisionFrontmatter) SetAssignee added in v0.55.0

func (f *VisionFrontmatter) SetAssignee(v string)

SetAssignee stores the assignee in the map.

func (*VisionFrontmatter) SetField added in v0.55.0

func (f *VisionFrontmatter) SetField(ctx context.Context, key, value string) error

SetField sets a frontmatter field by key from a string value.

func (*VisionFrontmatter) SetPageType added in v0.55.0

func (f *VisionFrontmatter) SetPageType(v string)

SetPageType stores the page_type in the map.

func (*VisionFrontmatter) SetPriority added in v0.55.0

func (f *VisionFrontmatter) SetPriority(ctx context.Context, p Priority) error

SetPriority validates the priority and stores it in the map.

func (*VisionFrontmatter) SetStatus added in v0.55.0

func (f *VisionFrontmatter) SetStatus(s VisionStatus) error

SetStatus validates and stores the status in the map.

func (*VisionFrontmatter) SetTags added in v0.55.0

func (f *VisionFrontmatter) SetTags(v []string)

SetTags stores tags in the map. Deletes key if v is nil or empty.

func (VisionFrontmatter) Status added in v0.55.0

func (f VisionFrontmatter) Status() VisionStatus

Status reads "status" key.

func (VisionFrontmatter) Tags added in v0.55.0

func (f VisionFrontmatter) Tags() []string

Tags reads "tags" key via GetStringSlice.

type VisionID added in v0.29.0

type VisionID string

VisionID represents a vision identifier (filename without .md extension).

func (VisionID) String added in v0.29.0

func (v VisionID) String() string

type VisionStatus added in v0.29.0

type VisionStatus string

VisionStatus represents the status of a vision.

const (
	VisionStatusActive    VisionStatus = "active"
	VisionStatusCompleted VisionStatus = "completed"
	VisionStatusArchived  VisionStatus = "archived"
)

func (VisionStatus) Validate added in v0.55.0

func (s VisionStatus) Validate(ctx context.Context) error

Validate returns an error if the status is not a valid canonical value.

type VisionStatuses added in v0.55.0

type VisionStatuses []VisionStatus

VisionStatuses is a collection of VisionStatus values.

func (VisionStatuses) Contains added in v0.55.0

func (v VisionStatuses) Contains(status VisionStatus) bool

Contains returns true if the collection contains the given status.

Jump to

Keyboard shortcuts

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