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

Interface ConfigStoreInterface

controlplane/control.go:221–251  ·  view source on GitHub ↗

ConfigStoreInterface abstracts the config store for the control plane. Defined here to avoid circular imports with the configstore package.

Source from the content-addressed store, hash-verified

219// PostgreSQL wire protocol, and SQL transpilation all happen here. Workers are
220// thin DuckDB execution engines reachable via Arrow Flight SQL over Unix sockets.
221type ControlPlane struct {
222 cfg ControlPlaneConfig
223 pool WorkerPool // non-nil in single-tenant process mode
224 sessions *SessionManager // non-nil in single-tenant process mode
225 rebalancer *MemoryRebalancer
226 srv *server.Server // Minimal server for cancel request routing
227 rateLimiter *server.RateLimiter
228 tlsConfig *tls.Config
229 pgListener net.Listener
230 upgrader *tableflip.Upgrader
231 parentPID int // tableflip parent PID (0 if first generation)
232 activeConns int64
233 closed bool
234 closeMu sync.Mutex
235 wg sync.WaitGroup
236 reloading atomic.Bool // guards against concurrent upgrade from double SIGUSR1
237 upgradeDraining atomic.Bool // true after upgrade succeeded; SIGTERM should exit immediately
238 sessionDraining atomic.Bool // true once any shutdown path closes session creation
239 preReady sessionLifecycle // authenticated pgwire handshakes not yet handed to the message loop
240 acmeManager *server.ACMEManager // ACME manager for Let's Encrypt HTTP-01 (nil when using static certs)
241 acmeDNSManager *server.ACMEDNSManager // ACME manager for DNS-01 (nil when not using DNS challenges)
242
243 // isRemoteBackend is true when workers run as separate K8s pods (remote backend).
244 isRemoteBackend bool
245
246 // Multi-tenant fields (non-nil in remote multitenant mode)
247 orgRouter OrgRouterInterface
248 configStore ConfigStoreInterface
249 apiServer *http.Server // API server on :8080 (shut down on graceful exit)
250 runtimeTracker *ControlPlaneRuntimeTracker
251 janitorLeader *JanitorLeaderManager
252
253 // computeMeter accumulates per-org compute-usage and flushes it to the
254 // durable buffer (remote/k8s backend with billing config only; nil

Implementers 2

fakeConfigStorecontrolplane/sni_kubernetes_test.go
ConfigStorecontrolplane/configstore/store.go

Calls

no outgoing calls

Tested by

no test coverage detected