MCPcopy Create free account
hub / github.com/apache/kvrocks-controller / RequiredCluster

Function RequiredCluster

server/middleware/middleware.go:104–114  ·  view source on GitHub ↗
(c *gin.Context)

Source from the content-addressed store, hash-verified

102}
103
104func RequiredCluster(c *gin.Context) {
105 s, _ := c.MustGet(consts.ContextKeyStore).(*store.ClusterStore)
106 cluster, err := s.GetCluster(c, c.Param("namespace"), c.Param("cluster"))
107 if err != nil {
108 helper.ResponseError(c, err)
109 return
110 }
111
112 c.Set(consts.ContextKeyCluster, cluster)
113 c.Next()
114}
115
116func RequiredClusterShard(c *gin.Context) {
117 s, _ := c.MustGet(consts.ContextKeyStore).(*store.ClusterStore)

Callers 3

TestShardBasicsFunction · 0.92
TestClusterBasicsFunction · 0.92
TestClusterMigrateDataFunction · 0.92

Calls 3

ResponseErrorFunction · 0.92
GetClusterMethod · 0.65
SetMethod · 0.65

Tested by 3

TestShardBasicsFunction · 0.74
TestClusterBasicsFunction · 0.74
TestClusterMigrateDataFunction · 0.74