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

Function clusterTestRouter

controlplane/admin/cluster_test.go:25–31  ·  view source on GitHub ↗

clusterTestRouter mounts the cluster-topology endpoints on a fresh gin engine backed by a fake clientset seeded with objs.

(objs ...runtime.Object)

Source from the content-addressed store, hash-verified

23// clusterTestRouter mounts the cluster-topology endpoints on a fresh gin engine
24// backed by a fake clientset seeded with objs.
25func clusterTestRouter(objs ...runtime.Object) *gin.Engine {
26 gin.SetMode(gin.TestMode)
27 cs := fake.NewSimpleClientset(objs...)
28 e := gin.New()
29 registerClusterAPI(e.Group("/api/v1"), cs)
30 return e
31}
32
33func getJSON(t *testing.T, e *gin.Engine, path string) map[string]any {
34 t.Helper()

Calls 1

registerClusterAPIFunction · 0.85

Tested by

no test coverage detected