Documentation
¶
Overview ¶
Package board is a simple Kanban board: cards in columns, persisted to disk. It is a richer cousin of the todo list — the agent can lay work out visually and move it across "todo", "doing", and "done" as it goes.
Index ¶
- Variables
- func Notify(key string)
- func Subscribe(key string) (<-chan struct{}, func())
- type Board
- func (b *Board) Add(key, title, note, column string) (Card, error)
- func (b *Board) Clear(key string) error
- func (b *Board) Keys() []string
- func (b *Board) List(key string) map[string][]Card
- func (b *Board) Move(key, id, column string) (Card, bool, error)
- func (b *Board) Remove(key, id string) (bool, error)
- func (b *Board) SyncTodos(key string, items []TodoMirror) error
- type Card
- type TodoMirror
Constants ¶
This section is empty.
Variables ¶
var DefaultColumns = []string{"todo", "doing", "done"}
DefaultColumns are the stages a card moves through.
Functions ¶
Types ¶
type Board ¶
type Board struct {
// contains filtered or unexported fields
}
Board persists cards for one key (a session) as a single JSON file.
func (*Board) SyncTodos ¶
func (b *Board) SyncTodos(key string, items []TodoMirror) error
SyncTodos mirrors a session's todo list onto the board, so the task list and the Kanban board are one thing seen two ways. Todo-derived cards (id "todo-<n>") are rebuilt from items; any other cards are left untouched. The status→column map is pending→todo, in_progress→doing, completed→done. Each item keeps a stable id by its position, so a status change reads as the same card moving columns rather than a delete-and-readd.
type Card ¶
type Card struct {
ID string `json:"id"`
Title string `json:"title"`
Note string `json:"note,omitempty"`
Column string `json:"column"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Card is one item on the board.
type TodoMirror ¶
TodoMirror is one todo item as SyncTodos needs it — decoupled from the tools package to avoid an import cycle.