Documentation ¶
Index ¶
- func Add(kubeconfig string)
- func Avg(numbers []float64) float64
- func Create(c *gin.Context)
- func Delete(c *gin.Context)
- func DivFloat64(a float64, b float64) float64
- func DivInt64(a int64, b int64) float64
- func GenNamespace(c *gin.Context)
- func GetDetail(c *gin.Context)
- func GetDevSpaceClusterList(c *gin.Context)
- func GetFromCache(kubeconfig string) []model.Resource
- func GetList(c *gin.Context)
- func GetSpaceDetail(c *gin.Context)
- func GetSpaceList(c *gin.Context)
- func GetStorageClass(c *gin.Context)
- func GetStorageClassByKubeConfig(c *gin.Context)
- func HasPrivilegeToSomeCluster(c *gin.Context, clusterId uint64) (*model.ClusterModel, error)
- func Init()
- func ListByUser(c *gin.Context)
- func Merge(availableKubeConfigs map[string]string)
- func Migrate(c *gin.Context)
- func Remove(kubeconfig string)
- func Update(c *gin.Context)
- type Cluster
- type ClusterDetailResponse
- type ClusterSafeList
- type ClusterStatus
- type ClusterUserMigrateRequest
- type Clusters
- type CreateClusterRequest
- type KubeConfig
- type Namespace
- type NsAndUsers
- type StorageClassRequest
- type StorageClassResponse
- type UpdateClusterRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
Create Add cluster @Summary Add cluster @Description Add cluster @Tags Cluster @Accept json @Produce json @param Authorization header string true "Authorization" @Param createCluster body cluster.CreateClusterRequest true "The cluster info" @Success 200 {object} model.ClusterModel @Router /v1/cluster [post]
func Delete ¶
GetList Delete the cluster completely @Summary Delete the cluster completely @Description Delete the cluster completely @Tags Cluster @Accept json @Produce json @Param Authorization header string true "Authorization" @Param id path uint64 true "Cluster ID" @Success 200 {object} api.Response "{"code":0,"message":"OK","data":null}" @Router /v1/cluster/{id} [delete]
func DivFloat64 ¶
func GenNamespace ¶
GenNamespace @Summary Gen Namespace @Description gen namespace for mesh dev space @Tags Cluster @Accept json @Produce json @param Authorization header string true "Authorization" @Param cluster path string true "cluster id" @Success 200 {object} cluster.Namespace "{"code":0,"message":"OK","data":cluster.Namespace}" @Router /v1/cluster/{id}/gen_namespace [get]
func GetDetail ¶
@Summary Get cluster details @Description Get cluster details @Tags Cluster @Accept json @Produce json @param Authorization header string true "Authorization" @Param id path string true "Cluster ID" @Success 200 {object} model.ClusterModel "include kubeconfig" @Router /v1/cluster/{id}/detail [get]
func GetDevSpaceClusterList ¶
GetDevSpaceClusterList Get the devSpace cluster list @Summary Get the cluster list which user can create devSpace @Description Get the cluster list which user can create devSpace @Tags Cluster @Accept json @Produce json @param Authorization header string true "Authorization" @Success 200 {object} model.ClusterList "{"code":0,"message":"OK","data":model.ClusterList}" @Router /v2/dev_space/cluster [get]
func GetFromCache ¶
func GetList ¶
GetList Get the cluster list @Summary Get the cluster list @Description Get the cluster list @Tags Cluster @Accept json @Produce json @param Authorization header string true "Authorization" @Success 200 {object} model.ClusterListVo "{"code":0,"message":"OK","data":model.ClusterListVo}" @Router /v1/cluster [get]
func GetSpaceDetail ¶
@Summary Details of a development environment in the cluster @Description Get cluster development environment details through cluster id and development environment id @Tags Cluster @Accept json @Produce json @param Authorization header string true "Authorization" @Param id path string true "Cluster ID" @Param space_id path string true "DevSpace ID" @Success 200 {object} model.ClusterUserModel "include kubeconfig" @Router /v1/cluster/{id}/dev_space/{space_id}/detail [get]
func GetSpaceList ¶
@Summary Cluster dev space list @Description Cluster entrance to obtain cluster development environment @Tags Cluster @Accept json @Produce json @param Authorization header string true "Authorization" @Param id path string true "Cluster ID" @Success 200 {object} model.ClusterUserModel "kubeconfig" @Router /v1/cluster/{id}/dev_space [get]
func GetStorageClass ¶
@Summary Get cluster storageClass from cluster list @Description Get cluster storageClass from cluster list @Tags Cluster @Accept json @Produce json @param Authorization header string true "Authorization" @Param id path string true "Cluster ID" @Success 200 {object} cluster.StorageClassResponse "include kubeconfig" @Router /v1/cluster/{id}/storage_class [get]
func GetStorageClassByKubeConfig ¶
@Summary Get cluster storageClass from create cluster @Description Get cluster storageClass from create cluster @Tags Cluster @Accept json @Produce json @param Authorization header string true "Authorization" @Param createCluster body cluster.StorageClassRequest true "The cluster info" @Success 200 {object} cluster.StorageClassResponse "include kubeconfig" @Router /v1/cluster/kubeconfig/storage_class [post]
func HasPrivilegeToSomeCluster ¶
HasPrivilegeToSomeCluster include - * devspace - * cluster
func ListByUser ¶
list permitted dev_space by user distinct by cluster id
func Update ¶
@Summary Update cluster @Description Update cluster @Tags Cluster @Accept json @Produce json @param Authorization header string true "Authorization" @Param id path string true "Cluster ID" @Param createCluster body cluster.UpdateClusterRequest true "The cluster info" @Success 200 {object} model.ClusterModel "include kubeconfig" @Router /v1/cluster/{id} [put]
Types ¶
type ClusterDetailResponse ¶
type ClusterDetailResponse struct { ID uint64 `json:"id"` Name string `json:"name"` Info string `json:"info"` UserId uint64 `json:"user_id"` Server string `json:"server"` KubeConfig string `json:"kubeconfig"` StorageClass string `json:"storage_class"` CreatedAt time.Time `gorm:"column:created_at" json:"created_at"` }
type ClusterSafeList ¶
type ClusterSafeList struct { ClusterList []*model.ClusterList Lock *sync.Mutex }
type ClusterStatus ¶
type ClusterUserMigrateRequest ¶
type ClusterUserMigrateRequest struct {
Migrate []NsAndUsers
}
type CreateClusterRequest ¶
type KubeConfig ¶
type KubeConfig struct {
Clusters []Clusters
}
type NsAndUsers ¶
type StorageClassRequest ¶
type StorageClassRequest struct {
KubeConfig string `json:"kubeconfig" example:"base64encode(value)"`
}
type StorageClassResponse ¶
type StorageClassResponse struct {
TypeName []string `json:"type_name"`
}
type UpdateClusterRequest ¶
type UpdateClusterRequest struct {
StorageClass string `json:"storage_class"`
}