Documentation
¶
Overview ¶
Package webui serves the kb board to a local browser: a JSON API under /api/ backed by the same store the CLI uses, plus an embedded static UI. The contract lives in docs/web-api.md.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Listen ¶
Listen binds addr (empty means 127.0.0.1:0). Unless allowRemote is set, a host that is not loopback is refused before any socket is opened.
func NewHandler ¶
NewHandler is the testable core: JSON API under /api/ and the embedded static UI at /. The event hub it opens stops with its last subscriber, so a caller that never shuts down (a test) leaks nothing.
Types ¶
type Options ¶
type Options struct {
// DataDir is the kb data directory; empty means the CLI default.
DataDir string
// User is the board owner; empty means "default".
User string
// Version is the launching binary's display version, reported by
// /api/meta.
Version string
// Addr is the listen address; empty means 127.0.0.1:0.
Addr string
// OpenBrowser launches the system browser on the served URL.
OpenBrowser bool
// AllowRemote permits a non-loopback Addr. Off by default because the API
// has no authentication: anything that can reach the port owns the board.
AllowRemote bool
}
Options configures Run.
Click to show internal directories.
Click to hide internal directories.