Documentation
¶
Overview ¶
Package serve provides an HTTP dashboard for kapm metrics, binding to localhost only with SSE-based live updates.
Package serve implements the kapm WebUI HTTP server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Assets embed.FS
var DesignMDRaw []byte
DesignMDRaw is the DESIGN.md source bytes embedded at build time. Kept in sync with the repo-root DESIGN.md by `go generate`.
var OpenBrowser = func(rawURL string) error { u, err := url.Parse(rawURL) if err != nil { return fmt.Errorf("browser open: invalid URL %q: %w", rawURL, err) } if u.Scheme != "http" && u.Scheme != "https" { return fmt.Errorf("browser open: unsupported scheme %q (want http or https)", u.Scheme) } return openBrowserFn(rawURL) }
OpenBrowser opens the given HTTP(S) URL in the user's default browser.
var Templates embed.FS
Functions ¶
This section is empty.
Types ¶
type DiffStatsResult ¶ added in v0.6.0
DiffStatsResult is the aggregated +/- summary for a group of FileChanges. HasCounts is false when all edits are oversized/unknown and no counts could be computed; in that case the UI should render a muted em-dash.
type KiroUsageReadFunc ¶ added in v0.12.0
KiroUsageReadFunc reads optional account-level Kiro usage. ok=false means usage is unavailable and should be omitted from the UI.
type Options ¶
type Options struct {
Port int
SessionsDir string
LogsDir string
IDEBaseDir string
CwdFilter string
Since time.Duration
MetricsTTL time.Duration // 0 means default 1s
SQLiteDBPath string
// KiroUsageRead, when set, enriches the Overview summary with account-level
// Kiro usage. It is optional so tests and library consumers never spawn an
// external command unless they opt in.
KiroUsageRead KiroUsageReadFunc
// KiroUsageTTL caches optional usage reads. 0 means default 5m.
KiroUsageTTL time.Duration
// MaxSSE caps concurrent SSE connections. 0 means default 64.
MaxSSE int
}
Options configures a Server.