todos

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package todos stores session-scoped todo lists.

Index

Constants

View Source
const FileName = "todos.json"

Variables

This section is empty.

Functions

func Path

func Path(workspace string) string

func RenderText

func RenderText(w io.Writer, report Report)

func Save

func Save(workspace string, state State) error

Types

type Item

type Item struct {
	ID         string    `json:"id"`
	Content    string    `json:"content"`
	ActiveForm string    `json:"activeForm,omitempty"`
	Status     string    `json:"status"`
	Priority   string    `json:"priority"`
	UpdatedAt  time.Time `json:"updated_at"`
}

func NormalizeItems

func NormalizeItems(items []Item) []Item

NormalizeItems applies stable defaults to todo items before validation, storage, or tool output.

type Report

type Report struct {
	Kind   string `json:"kind"`
	Action string `json:"action"`
	Status string `json:"status"`
	Total  int    `json:"total"`
	Items  []Item `json:"items"`
}

func Add

func Add(workspace string, content string, priority string) (Report, error)

func Clear

func Clear(workspace string) (Report, error)

func List

func List(workspace string) (Report, error)

func Replace

func Replace(workspace string, items []Item) (Report, error)

func UpdateStatus

func UpdateStatus(workspace string, id string, status string) (Report, error)

type State

type State struct {
	Kind      string    `json:"kind"`
	UpdatedAt time.Time `json:"updated_at"`
	Items     []Item    `json:"items"`
}

func Load

func Load(workspace string) (State, error)

Jump to

Keyboard shortcuts

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