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

Function RequiredNamespace

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

Source from the content-addressed store, hash-verified

87}
88
89func RequiredNamespace(c *gin.Context) {
90 s, _ := c.MustGet(consts.ContextKeyStore).(*store.ClusterStore)
91 ok, err := s.ExistsNamespace(c, c.Param("namespace"))
92 if err != nil {
93 helper.ResponseError(c, err)
94 return
95 }
96 if !ok {
97 helper.ResponseBadRequest(c, errors.New("namespace not found"))
98 c.Abort()
99 } else {
100 c.Next()
101 }
102}
103
104func RequiredCluster(c *gin.Context) {
105 s, _ := c.MustGet(consts.ContextKeyStore).(*store.ClusterStore)

Callers

nothing calls this directly

Calls 3

ResponseErrorFunction · 0.92
ResponseBadRequestFunction · 0.92
ExistsNamespaceMethod · 0.65

Tested by

no test coverage detected