MCPcopy Create free account
hub / github.com/PostHog/duckgres / RegisterAPI

Function RegisterAPI

controlplane/admin/api.go:82–91  ·  view source on GitHub ↗

RegisterAPI registers all admin REST endpoints on the given router group. fetcher (may be nil) aggregates per-CP live state (sessions/workers) across replicas so the dashboard shows cluster-wide numbers instead of one CP's slice.

(r *gin.RouterGroup, store *configstore.ConfigStore, info OrgStackInfo, fetcher PeerFetcher)

Source from the content-addressed store, hash-verified

80 // AllWorkerStatuses returns all workers across orgs.
81 AllWorkerStatuses() []WorkerStatus
82 // AllSessionStatuses returns all active sessions across orgs.
83 AllSessionStatuses() []SessionStatus
84}
85
86// RegisterAPI registers all admin REST endpoints on the given router group.
87// fetcher (may be nil) aggregates per-CP live state (sessions/workers) across
88// replicas so the dashboard shows cluster-wide numbers instead of one CP's slice.
89func RegisterAPI(r *gin.RouterGroup, store *configstore.ConfigStore, info OrgStackInfo, fetcher PeerFetcher, awsRegion string) {
90 registerAPIWithStore(r, newGormAPIStore(store), info, fetcher)
91 // Generic read-only models explorer (sidebar + table + detail UI). Reads
92 // the concrete store directly because it needs the runtime schema name and
93 // raw DB for tables the typed apiStore interface doesn't surface.
94 registerModelsAPI(r, store)

Callers 1

SetupMultiTenantFunction · 0.92

Calls 4

registerAPIWithStoreFunction · 0.85
newGormAPIStoreFunction · 0.85
registerModelsAPIFunction · 0.85
registerOperatorsAPIFunction · 0.85

Tested by

no test coverage detected