webui

package
v0.29.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

Package webui hosts an HTTP server serving a JSON API and embedded web UI for a single TASKS.md/csv file. It is started by the `md webui` subcommand and consumed both by browsers and by the meads VS Code extension.

Index

Constants

This section is empty.

Variables

View Source
var ErrNoBindClient = errors.New("no VS Code client bound")

ErrNoBindClient is returned when a vscode.* RPC call is attempted but no VS Code client is currently connected to /bind-vscode.

Functions

This section is empty.

Types

type Config

type Config struct {
	Store *meads.Store
	// Host to bind, e.g. "127.0.0.1". Defaults to 127.0.0.1.
	Host string
	// Port to listen on. 0 = pick a random free port.
	Port int
	// Token required on every request (bearer or ?token=). Auto-generated if empty.
	Token string
	// Stdout format on start: "url", "json", or "none".
	Print string
	// Open browser after start (ignored when Print=none).
	Open bool
	// Dev mode: serve assets from disk rather than embed. Enabled via WEBUI_DEV=1.
	Dev bool
	// Stdout target for the start line. Defaults to os.Stdout.
	Stdout io.Writer
	// Stderr target for log messages. Defaults to os.Stderr.
	Stderr io.Writer
}

Config controls a Server.

type Server

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

Server is an HTTP server exposing the webui API.

func New

func New(cfg Config) (*Server, error)

New builds a Server from cfg. Call Run to start.

func (*Server) Addr

func (s *Server) Addr() string

Addr returns the final listen address. Only valid after Run returns a non-blocking URL.

func (*Server) Run

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

Run binds the listener, prints the start line, and blocks until ctx is canceled.

func (*Server) Stop

func (s *Server) Stop()

Stop signals Run to exit.

func (*Server) Token

func (s *Server) Token() string

Token returns the bearer token required by all HTTP routes.

func (*Server) URL

func (s *Server) URL() string

URL returns the base URL clients should use. Only valid after the listener is bound.

Jump to

Keyboard shortcuts

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