Documentation
¶
Index ¶
- func FormatDeletedJSON(displayID uint) (string, error)
- func FormatRemovedPretty(displayID uint) string
- func FormatTaskJSON(task todo.Task) (string, error)
- func FormatTaskPretty(task todo.Task, action string) (string, error)
- func FormatTaskPrettyWithID(displayID uint, action string) string
- func FormatTasksJSON(tasks []todo.Task) (string, error)
- func FormatTasksPretty(tasks []todo.Task, reference time.Time) (string, error)
- type TaskOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatDeletedJSON ¶
FormatDeletedJSON returns a JSON response for a deleted task.
func FormatRemovedPretty ¶
FormatRemovedPretty formats the removal message.
func FormatTaskJSON ¶
FormatTaskJSON converts a single task to JSON string.
func FormatTaskPretty ¶
FormatTaskPretty formats a single task as a one-liner for add/complete operations. Format: "Task {displayID} added." or "Task {displayID} completed." Note: displayID should be passed as a parameter since the task's DisplayID may be nil after completion.
func FormatTaskPrettyWithID ¶
FormatTaskPrettyWithID formats a single task as a one-liner using an explicit displayID. This is useful when the task's DisplayID may be nil (e.g., after completion).
func FormatTasksJSON ¶
FormatTasksJSON converts a slice of tasks to JSON string.
Types ¶
type TaskOutput ¶
type TaskOutput struct {
ULID string `json:"ulid"` // Unique identifier
ID *uint `json:"id,omitempty"` // DisplayID
Description string `json:"description"`
Priority bool `json:"priority"`
Due string `json:"due,omitempty"` // YYYY-MM-DD format
Status string `json:"status"`
CompletedAt string `json:"completed_at,omitempty"` // YYYY-MM-DD format
CreatedAt string `json:"created_at"`
}
TaskOutput represents a task in JSON output format.