(c *gin.Context)
| 102 | } |
| 103 | |
| 104 | func 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 | |
| 116 | func RequiredClusterShard(c *gin.Context) { |
| 117 | s, _ := c.MustGet(consts.ContextKeyStore).(*store.ClusterStore) |