{"modulePath":"github.com/alrayyes/pipeline-analytics","version":"v0.94.9","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package httpserver\n\nPackage httpserver builds the pipeline-analytics HTTP handler tree.\n\n## Functions\n\n```go\nfunc New(deps Deps) http.Handler\n```\nNew returns the root HTTP handler.\n\n## Types\n\n```go\ntype Deps struct {\n\tRegistrar      *ingestion.Registrar\n\tIngestionStore ingestion.Store\n\tRunStore       ingestion.RunStore\n\t// Reconciler is called to poll a repo immediately when a Forgejo\n\t// webhook fires -- see webhooksHandler.forgejo.\n\tReconciler ingestion.RepoReconciler\n\tMetrics    *metrics.Service\n\t// ForgeTokens keeps the tokens saved for registering repos. nil is fine:\n\t// the routes aren't served and a token must then be given each time.\n\tForgeTokens ingestion.ForgeTokenStore\n\t// JobLogs reads a job's log from its forge for GET /api/runs/{runId}/\n\t// jobs/{jobId}/log. nil is fine: the route then answers 404.\n\tJobLogs *ingestion.JobLogService\n\t// RunActions re-runs and cancels runs on their forge for POST\n\t// /api/runs/{runId}/rerun and /cancel. Nil leaves both routes unmounted.\n\tRunActions *ingestion.RunActionService\n\tAuth       *auth.Service\n\tAuthStore  auth.Store\n\tSettings   *settings.Service\n\t// GitHubRateLimits reports the rate-limit status last observed for a\n\t// GitHub token, for GET /api/insights/github-rate-limit. nil is fine --\n\t// the endpoint just reports every token with no status yet.\n\tGitHubRateLimits ingestion.RateLimitReporter\n\t// Ready reports whether the instance can serve, for GET /readyz --\n\t// in production, a database read. nil means always ready, so a Deps\n\t// built without one (most tests) still answers.\n\tReady func(ctx context.Context) error\n\t// ReadyCacheTTL is how long /readyz reuses the last probe result, so a\n\t// router polling it can't hammer the dependency. Zero means\n\t// defaultReadyCacheTTL.\n\tReadyCacheTTL time.Duration\n\t// Draining, once true, makes /readyz answer 503 without probing, so a\n\t// shutting-down instance leaves rotation while it keeps serving. nil\n\t// means never draining.\n\tDraining *atomic.Bool\n\t// Version is reported by GET /api/version -- the build's tagged\n\t// version, or \"dev\" for a local build.\n\tVersion string\n\t// Assets is the built frontend (internal/webassets.FS()), served for\n\t// every path the API doesn't claim, falling back to index.html for the\n\t// SPA client router.\n\tAssets fs.FS\n}\n```\nDeps are New's dependencies.\n\n","path":"github.com/alrayyes/pipeline-analytics/internal/httpserver","name":"httpserver","synopsis":"Package httpserver builds the pipeline-analytics HTTP handler tree.","isRedistributable":true}
