(c *gin.Context)
| 87 | } |
| 88 | |
| 89 | func 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 | |
| 104 | func RequiredCluster(c *gin.Context) { |
| 105 | s, _ := c.MustGet(consts.ContextKeyStore).(*store.ClusterStore) |
nothing calls this directly
no test coverage detected