Documentation
¶
Overview ¶
Package dashboard serves WB's local read-only operations dashboard and API.
Index ¶
Constants ¶
View Source
const APISchemaVersion = 1
Variables ¶
This section is empty.
Functions ¶
func NewHandler ¶
NewHandler returns the dashboard UI and versioned read-only API.
Types ¶
type HubDeliveryMarker ¶ added in v0.124.6
type HubDeliveryMarker struct {
ID string `json:"id,omitempty"`
Event string `json:"event,omitempty"`
OccurredAt time.Time `json:"occurred_at"`
}
HubDeliveryMarker names one repository event and when the hub handled it.
type HubHealth ¶ added in v0.124.6
type HubHealth struct {
Mounted bool `json:"mounted"`
Polling bool `json:"polling"`
PollIntervalSeconds float64 `json:"poll_interval_seconds,omitempty"`
RepositoriesPolled int `json:"repositories_polled"`
LastEventReceived *HubDeliveryMarker `json:"last_event_received,omitempty"`
LastEventAcknowledged *HubDeliveryMarker `json:"last_event_acknowledged,omitempty"`
}
HubHealth is the self-hosted bench hub's live state, as /api/v1/health reports it. Every field is derived from the hub's own services; none of it is a secret.
type Options ¶
type Options struct {
ProjectsRoot string
Version string
DaemonPID int
SchedulerGeneration uint64
Now func() time.Time
CacheTTL time.Duration
InventoryIndexPath string
InventoryIndexTTL time.Duration
// Mounts attaches extra subtrees to the same loopback listener, keyed by
// the path prefix each one owns (it must start and end with "/"). A
// self-hosted bench uses it for the hub API under /v0/workbench/ and the
// embedded dashboard under /workbench/; without a hub section the map is
// empty and the served routes are exactly what they were.
Mounts map[string]http.Handler
// Hub reports the live state of a self-hosted bench hub for
// /api/v1/health. `wb daemon status` runs in a different process from
// `wb daemon serve`, so the numbers only this process knows — how many
// repositories the last poll tick read, and the delivery markers the hub's
// own StatusService resolves — reach it through the health endpoint rather
// than by opening the hub's store a second time. Nil when there is no hub.
Hub func(context.Context) HubHealth
// LogPath is the daemon's own runtime log file. When set, /api/v1/log
// serves a tail of it directly — the daemon is the log's only authority,
// so a reverse proxy in front of it never needs disk access of its own.
// Empty disables the endpoint (503).
LogPath string
}
type Overview ¶
type Overview struct {
SchemaVersion int `json:"schema_version"`
GeneratedAt time.Time `json:"generated_at"`
Machine Machine `json:"machine"`
Operations runlog.Summary `json:"operations"`
Worktrees []Worktree `json:"worktrees"`
Diagnostics int `json:"diagnostics"`
Inventory Inventory `json:"inventory"`
}
type Worktree ¶
type Worktree struct {
Task string `json:"task"`
Repository string `json:"repository"`
Branch string `json:"branch"`
Owner string `json:"owner,omitempty"`
OwnerState string `json:"owner_state"`
AgeSeconds int64 `json:"age_seconds,omitempty"`
LastActivityAt time.Time `json:"last_activity_at,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.