Documentation
¶
Overview ¶
Package httpserver builds the pipeline-analytics HTTP handler tree.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Deps ¶ added in v0.3.0
type Deps struct {
Registrar *ingestion.Registrar
IngestionStore ingestion.Store
RunStore ingestion.RunStore
// Reconciler is called to poll a repo immediately when a Forgejo
// webhook fires -- see webhooksHandler.forgejo.
Reconciler ingestion.RepoReconciler
Metrics *metrics.Service
// ForgeTokens keeps the tokens saved for registering repos. nil is fine:
// the routes aren't served and a token must then be given each time.
ForgeTokens ingestion.ForgeTokenStore
// JobLogs reads a job's log from its forge for GET /api/runs/{runId}/
// jobs/{jobId}/log. nil is fine: the route then answers 404.
JobLogs *ingestion.JobLogService
// RunActions re-runs and cancels runs on their forge for POST
// /api/runs/{runId}/rerun and /cancel. Nil leaves both routes unmounted.
RunActions *ingestion.RunActionService
Auth *auth.Service
AuthStore auth.Store
Settings *settings.Service
// GitHubRateLimits reports the rate-limit status last observed for a
// GitHub token, for GET /api/insights/github-rate-limit. nil is fine --
// the endpoint just reports every token with no status yet.
GitHubRateLimits ingestion.RateLimitReporter
// Ready reports whether the instance can serve, for GET /readyz --
// in production, a database read. nil means always ready, so a Deps
// built without one (most tests) still answers.
Ready func(ctx context.Context) error
// ReadyCacheTTL is how long /readyz reuses the last probe result, so a
// router polling it can't hammer the dependency. Zero means
// defaultReadyCacheTTL.
ReadyCacheTTL time.Duration
// Draining, once true, makes /readyz answer 503 without probing, so a
// shutting-down instance leaves rotation while it keeps serving. nil
// means never draining.
Draining *atomic.Bool
// Version is reported by GET /api/version -- the build's tagged
// version, or "dev" for a local build.
Version string
// Assets is the built frontend (internal/webassets.FS()), served for
// every path the API doesn't claim, falling back to index.html for the
// SPA client router.
Assets fs.FS
}
Deps are New's dependencies.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.