Documentation
¶
Index ¶
- Variables
- type AuthHeaders
- type BuildBenchmarkArtifact
- type BuildRecord
- type Config
- type OperatorProfile
- type QueuedOperation
- type RefreshRecord
- type RefreshTaskConfig
- type ReleaseView
- type RevisionStatus
- type RunningOperation
- type Service
- type SpanViewRow
- type State
- type SupportBundleFile
- type SupportBundleInput
- type SupportBundleManifest
- type WebhookConfig
Constants ¶
This section is empty.
Variables ¶
var ErrBuildQueueFull = errors.New("build queue is full")
Functions ¶
This section is empty.
Types ¶
type AuthHeaders ¶
type AuthHeaders struct {
UserID string
Username string
DisplayName string
Email string
Groups string
Roles string
Scopes string
AuthMethod string
}
AuthHeaders maps identity assertions and the machine-authentication marker supplied by a trusted ForwardAuth proxy. Empty optional header names disable that assertion. The default preserves the stable hlab-auth header contract.
func DefaultAuthHeaders ¶
func DefaultAuthHeaders() AuthHeaders
DefaultAuthHeaders returns the header contract used by hlab-auth.
type BuildBenchmarkArtifact ¶
type BuildBenchmarkArtifact struct {
PostsProcessed int `json:"posts_processed"`
FeedsGenerated int `json:"feeds_generated"`
Duration float64 `json:"duration_seconds"`
Warnings []string `json:"warnings,omitempty"`
Benchmark buildstats.Summary `json:"benchmark"`
Content diagnostics.ContentLedgerSnapshot `json:"content"`
}
BuildBenchmarkArtifact is the stable subset of `markata-go build --benchmark-json` that Builder Admin retains for diagnostics. Unknown fields are intentionally ignored so CLI presentation can evolve independently.
type BuildRecord ¶
type BuildRecord struct {
ID string `json:"id"`
Kind string `json:"kind"`
ActorID string `json:"actor_id,omitempty"`
Status string `json:"status"`
TriggerType string `json:"trigger_type"`
TriggerDetail string `json:"trigger_detail,omitempty"`
ChangedPaths []string `json:"changed_paths,omitempty"`
Impact string `json:"impact,omitempty"`
EnqueuedAt time.Time `json:"enqueued_at"`
StartedAt time.Time `json:"started_at"`
FinishedAt time.Time `json:"finished_at"`
QueueWaitMS int64 `json:"queue_wait_ms"`
PrepareMS int64 `json:"prepare_ms"`
BuildMS int64 `json:"build_ms"`
PromoteMS int64 `json:"promote_ms"`
PruneMS int64 `json:"prune_ms"`
TotalMS int64 `json:"total_ms"`
ReleaseID string `json:"release_id,omitempty"`
ReleasePath string `json:"release_path,omitempty"`
BecameLive bool `json:"became_live"`
LogPath string `json:"log_path,omitempty"`
LogDiagnostics []servecontrol.Diagnostic `json:"log_diagnostics,omitempty"`
PerfSummary []string `json:"perf_summary,omitempty"`
Error string `json:"error,omitempty"`
RollbackRelease string `json:"rollback_release,omitempty"`
BuilderVersion string `json:"builder_version,omitempty"`
BuilderCommit string `json:"builder_commit,omitempty"`
SourceCommit string `json:"source_commit,omitempty"`
}
type Config ¶
type Config struct {
Host string
Port int
SourceDir string
BuilderVersion string
BuilderCommit string
SiteDir string
WorkDir string
ConfigPath string
CacheMount string
HistoryDir string
WatchEnabled bool
AutoBuildOnUpgrade bool
WatchDebounce time.Duration
Fast bool
MermaidMode string
ReleasesKeep int
SuccessfulBuildsKeep int
FailedBuildsKeep int
RefreshRunsKeep int
RefreshTasks []RefreshTaskConfig
BuildTimeout time.Duration
TrustedProxyCIDRs []string
AuthHeaders AuthHeaders
PublicAuthOrigin string
PublicOrigin string
PreviewOrigin string
Webhook WebhookConfig
}
type OperatorProfile ¶
type OperatorProfile struct {
UserID string
Username string
DisplayName string
Email string
Groups string
Roles string
Scopes string
}
OperatorProfile contains display-only assertions supplied by hlab-auth. UserID is the durable identity key; no authorization decision is based on the other fields.
type QueuedOperation ¶
type QueuedOperation struct {
ID string `json:"id"`
Kind string `json:"kind"`
ActorID string `json:"actor_id,omitempty"`
Label string `json:"label"`
TriggerType string `json:"trigger_type"`
Detail string `json:"detail,omitempty"`
Changed []string `json:"changed,omitempty"`
EnqueuedAt time.Time `json:"enqueued_at"`
ReleaseID string `json:"release_id,omitempty"`
TaskName string `json:"task_name,omitempty"`
SyncSource bool `json:"sync_source,omitempty"`
}
type RefreshRecord ¶
type RefreshRecord struct {
ID string `json:"id"`
ActorID string `json:"actor_id,omitempty"`
TaskName string `json:"task_name"`
Status string `json:"status"`
TriggerType string `json:"trigger_type"`
TriggerDetail string `json:"trigger_detail,omitempty"`
EnqueuedAt time.Time `json:"enqueued_at"`
StartedAt time.Time `json:"started_at"`
FinishedAt time.Time `json:"finished_at"`
QueueWaitMS int64 `json:"queue_wait_ms"`
RunMS int64 `json:"run_ms"`
TotalMS int64 `json:"total_ms"`
LogPath string `json:"log_path,omitempty"`
LogDiagnostics []servecontrol.Diagnostic `json:"log_diagnostics,omitempty"`
EnqueuedBuildID string `json:"enqueued_build_id,omitempty"`
EnqueueBuildOnSuccess bool `json:"enqueue_build_on_success"`
Command []string `json:"command,omitempty"`
Error string `json:"error,omitempty"`
}
type RefreshTaskConfig ¶
type ReleaseView ¶
type ReleaseView struct {
ID string `json:"id"`
Path string `json:"path"`
CreatedAt time.Time `json:"created_at"`
Current bool `json:"current"`
BuildID string `json:"build_id,omitempty"`
BuildStatus string `json:"build_status,omitempty"`
BuilderCommit string `json:"builder_commit,omitempty"`
SourceCommit string `json:"source_commit,omitempty"`
RollbackOnly bool `json:"rollback_only"`
}
type RevisionStatus ¶
type RevisionStatus struct {
BuilderVersion string `json:"builder_version,omitempty"`
BuilderCommit string `json:"builder_commit,omitempty"`
SourceCommit string `json:"source_commit,omitempty"`
LastBuiltCommit string `json:"last_built_commit,omitempty"`
LastBuiltSource string `json:"last_built_source,omitempty"`
LastBuiltAt time.Time `json:"last_built_at,omitempty"`
LastBuildID string `json:"last_build_id,omitempty"`
LiveBuilderCommit string `json:"live_builder_commit,omitempty"`
LiveSourceCommit string `json:"live_source_commit,omitempty"`
SourceChanged bool `json:"source_changed"`
Status string `json:"status"`
}
RevisionStatus compares the running Builder executable with successful build provenance. Unknown is intentional for legacy records without reliable SHA.
type RunningOperation ¶
type RunningOperation struct {
ID string `json:"id"`
Kind string `json:"kind"`
ActorID string `json:"actor_id,omitempty"`
Label string `json:"label"`
TriggerType string `json:"trigger_type"`
Detail string `json:"detail,omitempty"`
StartedAt time.Time `json:"started_at"`
EnqueuedAt time.Time `json:"enqueued_at,omitempty"`
Phase string `json:"phase"`
Impact string `json:"impact,omitempty"`
}
type SpanViewRow ¶
type SpanViewRow struct {
ID string
ParentID string
Name string
Stage string
Plugin string
Depth int
StartMS int64
DurationMS int64
Status string
Critical bool
Attributes map[string]string
}
SpanViewRow is the bounded presentation model used by Builder Admin trace views. It keeps layout concerns out of the buildstats package.
type State ¶
type State struct {
Queue []QueuedOperation `json:"queue"`
Running *RunningOperation `json:"running,omitempty"`
Builds []BuildRecord `json:"builds"`
Refresh []RefreshRecord `json:"refresh"`
}
type SupportBundleFile ¶
SupportBundleFile describes one bounded file in a support bundle.
type SupportBundleInput ¶
type SupportBundleInput struct {
BuildID string
DiagnosticMarkdown []byte
BenchmarkJSON []byte
TraceJSON []byte
}
SupportBundleInput contains already-sanitized diagnostic artifacts for one build. Raw logs are deliberately not accepted here; they need a dedicated sanitizer before they can safely enter a portable support bundle.
type SupportBundleManifest ¶
type SupportBundleManifest struct {
SchemaVersion int `json:"schema_version"`
BuildID string `json:"build_id"`
Files []SupportBundleFile `json:"files"`
}
SupportBundleManifest describes the portable contents of a support bundle.
type WebhookConfig ¶
type WebhookConfig struct {
Enabled bool `json:"enabled"`
Branch string `json:"branch"`
Secret string `json:"-"`
}
WebhookConfig configures a signed GitHub or Forgejo push webhook. Secret is deliberately excluded from JSON responses served by the admin API.