board

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2026 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

Constants

This section is empty.

Variables

View Source
var DefaultColumns = []string{"todo", "doing", "done"}

DefaultColumns are the stages a card moves through.

Functions

func Notify

func Notify(key string)

Notify signals that a session's board changed. Non-blocking: a slow or full subscriber simply misses this tick and catches up on the next one, since each tick just tells the handler to re-read and re-send the whole board.

func Subscribe

func Subscribe(key string) (<-chan struct{}, func())

Subscribe returns a channel that receives a signal whenever the given session's board changes, plus a cancel func to unsubscribe.

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 New

func New(dir string) *Board

New opens a board store under dir.

func (*Board) Add

func (b *Board) Add(key, title, note, column string) (Card, error)

Add creates a card in a column (default "todo").

func (*Board) Clear

func (b *Board) Clear(key string) error

Clear removes an entire board (all cards for a key) by deleting its file.

func (*Board) Keys

func (b *Board) Keys() []string

Keys lists the session keys that have a board.

func (*Board) List

func (b *Board) List(key string) map[string][]Card

List returns the cards grouped by column, in column order.

func (*Board) Move

func (b *Board) Move(key, id, column string) (Card, bool, error)

Move sends a card to another column.

func (*Board) Remove

func (b *Board) Remove(key, id string) (bool, error)

Remove deletes a card.

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

type TodoMirror struct {
	Content string
	Status  string
}

TodoMirror is one todo item as SyncTodos needs it — decoupled from the tools package to avoid an import cycle.

Jump to

Keyboard shortcuts

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