Documentation
¶
Overview ¶
Package metadata provides Tasks list parsing and structures.
Index ¶
- type Task
- func (t *Task) FormatCompletedDate(layout string) string
- func (t *Task) FormatDueDate(layout string) string
- func (t *Task) GetCheckboxSymbol() string
- func (t *Task) HasDueDate() bool
- func (t *Task) HasLinks() bool
- func (t *Task) HasNotes() bool
- func (t *Task) HasParent() bool
- func (t *Task) IsCompleted() bool
- func (t *Task) ToMarkdown(indent int) string
- type TaskLink
- type TaskList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Task ¶
type Task struct {
Title string `json:"title"`
Notes string `json:"notes,omitempty"`
Status string `json:"status"` // "completed" or "needsAction"
Due time.Time `json:"due,omitempty"`
Completed time.Time `json:"completed,omitempty"`
Parent string `json:"parent,omitempty"` // ID of parent task
Position string `json:"position,omitempty"` // Position within parent/list
Links []TaskLink `json:"links,omitempty"`
IsDeleted bool `json:"deleted,omitempty"`
Updated time.Time `json:"updated"`
}
Task represents a single task within a list.
func (*Task) FormatCompletedDate ¶
FormatCompletedDate formats the completed date using the given layout.
func (*Task) FormatDueDate ¶
FormatDueDate formats the due date using the given layout.
func (*Task) GetCheckboxSymbol ¶
GetCheckboxSymbol returns the appropriate checkbox symbol for markdown.
func (*Task) HasDueDate ¶
HasDueDate returns true if the task has a due date set.
func (*Task) IsCompleted ¶
IsCompleted returns true if the task is marked as completed.
func (*Task) ToMarkdown ¶
ToMarkdown converts the task to markdown format.
type TaskLink ¶
type TaskLink struct {
Description string `json:"description,omitempty"`
URL string `json:"link"`
Type string `json:"type,omitempty"`
}
TaskLink represents a link associated with a task.
type TaskList ¶
type TaskList struct {
Title string `json:"title"`
LastModified time.Time `json:"last_modified"`
Tasks []Task `json:"tasks"`
}
TaskList represents a Google Tasks list with all its metadata.
func ParseTasksJSON ¶
ParseTasksJSON parses a Google Tasks JSON file.
func (*TaskList) BuildHierarchy ¶
BuildHierarchy organizes tasks into a tree structure based on Parent field. Returns top-level tasks with their subtasks properly nested.
func (*TaskList) CountCompleted ¶
CountCompleted returns the number of completed tasks in the list.
func (*TaskList) CountPending ¶
CountPending returns the number of pending tasks in the list.