server

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ColumnBlocked = "blocked"
	ColumnReady   = "ready"
	ColumnAgent   = "agent"
	ColumnHuman   = "human"
	ColumnDone    = "done"
)

Column represents kanban board columns.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActivityResponse

type ActivityResponse struct {
	Activities []tick.Activity `json:"activities"`
}

ActivityResponse is the response body for GET /api/activity.

type AddNoteRequest

type AddNoteRequest struct {
	Message string `json:"message"`
}

AddNoteRequest is the request body for POST /api/ticks/:id/note.

type AddNoteResponse

type AddNoteResponse struct {
	tick.Tick
	IsBlocked bool   `json:"isBlocked"`
	Column    string `json:"column"`
	NotesList []Note `json:"notesList"`
}

AddNoteResponse is the response body for POST /api/ticks/:id/note.

type ApproveTickResponse

type ApproveTickResponse struct {
	tick.Tick
	IsBlocked bool   `json:"isBlocked"`
	Column    string `json:"column"`
	Closed    bool   `json:"closed"`
}

ApproveTickResponse is the response body for POST /api/ticks/:id/approve.

type BlockerDetail

type BlockerDetail struct {
	ID     string `json:"id"`
	Title  string `json:"title"`
	Status string `json:"status"`
}

BlockerDetail contains information about a blocker tick.

type CloseTickRequest

type CloseTickRequest struct {
	Reason string `json:"reason,omitempty"`
}

CloseTickRequest is the request body for POST /api/ticks/:id/close.

type CloseTickResponse

type CloseTickResponse struct {
	tick.Tick
	IsBlocked bool   `json:"isBlocked"`
	Column    string `json:"column"`
}

CloseTickResponse is the response body for POST /api/ticks/:id/close.

type CreateTickRequest

type CreateTickRequest struct {
	Title       string  `json:"title"`
	Description string  `json:"description,omitempty"`
	Type        string  `json:"type,omitempty"`
	Priority    *int    `json:"priority,omitempty"`
	Parent      string  `json:"parent,omitempty"`
	Requires    *string `json:"requires,omitempty"`
	// After is the soft ordering preference (never gates readiness, unlike blocked_by).
	After []string `json:"after,omitempty"`
}

CreateTickRequest is the request body for POST /api/ticks.

type CreateTickResponse

type CreateTickResponse struct {
	tick.Tick
	IsBlocked bool   `json:"isBlocked"`
	Column    string `json:"column"`
}

CreateTickResponse is the response body for POST /api/ticks.

type EpicInfo

type EpicInfo struct {
	ID    string `json:"id"`
	Title string `json:"title"`
}

EpicInfo represents an epic for the filter dropdown.

type GetTickResponse

type GetTickResponse struct {
	tick.Tick
	IsBlocked      bool            `json:"isBlocked"`
	Column         string          `json:"column"`
	NotesList      []Note          `json:"notesList"`
	BlockerDetails []BlockerDetail `json:"blockerDetails"`
}

GetTickResponse is the response body for GET /api/ticks/:id.

type InfoResponse

type InfoResponse struct {
	RepoName string     `json:"repoName"`
	Epics    []EpicInfo `json:"epics"`
}

InfoResponse is the response body for GET /api/info.

type ListTicksResponse

type ListTicksResponse struct {
	Ticks []TickResponse `json:"ticks"`
}

ListTicksResponse is the response body for GET /api/ticks.

type Note

type Note struct {
	Timestamp string `json:"timestamp,omitempty"`
	Author    string `json:"author,omitempty"`
	Text      string `json:"text"`
}

Note represents a parsed note entry.

type RejectTickRequest

type RejectTickRequest struct {
	Feedback string `json:"feedback"`
}

RejectTickRequest is the request body for POST /api/ticks/:id/reject.

type RejectTickResponse

type RejectTickResponse struct {
	tick.Tick
	IsBlocked bool   `json:"isBlocked"`
	Column    string `json:"column"`
	Closed    bool   `json:"closed"`
}

RejectTickResponse is the response body for POST /api/ticks/:id/reject.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server represents the ticks board HTTP server.

func New

func New(tickDir string, port int, opts ...ServerOption) (*Server, error)

New creates a new ticks board server.

func (*Server) Run

func (s *Server) Run(ctx context.Context) error

Run starts the HTTP server and blocks until the context is cancelled.

func (*Server) TickDir

func (s *Server) TickDir() string

TickDir returns the path to the .tick directory being served.

type ServerOption added in v0.7.0

type ServerOption func(*Server)

ServerOption configures the server.

func WithDevMode added in v0.7.0

func WithDevMode(enabled bool) ServerOption

WithDevMode enables dev mode, serving UI from disk instead of embedded.

func WithListener added in v0.14.0

func WithListener(l net.Listener) ServerOption

WithListener makes the server serve on an already-bound listener instead of binding its own ":port" socket. This lets callers bind first (eliminating the probe-then-bind race) and only announce the address once the bind has succeeded. The server takes over the listener and closes it on shutdown.

type TickResponse

type TickResponse struct {
	tick.Tick
	IsBlocked bool   `json:"isBlocked"`
	Column    string `json:"column"`
}

TickResponse is a tick with computed fields for the API response.

type UpdateTickRequest

type UpdateTickRequest struct {
	Priority *int    `json:"priority,omitempty"`
	Type     *string `json:"type,omitempty"`
	Parent   *string `json:"parent,omitempty"`
	Owner    *string `json:"owner,omitempty"`
	Requires *string `json:"requires,omitempty"`
	// After is the soft ordering preference (never gates readiness, unlike
	// blocked_by). Present-and-empty clears the field; absent leaves it unchanged.
	After *[]string `json:"after,omitempty"`
}

UpdateTickRequest is the request body for PATCH /api/ticks/:id.

Jump to

Keyboard shortcuts

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