Documentation ¶
Index ¶
- func Create(c *gin.Context)
- func Delete(c *gin.Context)
- func DoList(params *model.ClusterUserModel, userId uint64, ...) ([]*model.ClusterUserV2, error)
- func GetAppsInfo(c *gin.Context)
- func GetDevSpaceDetail(c *gin.Context)
- func GetFirst(c *gin.Context)
- func GetJoinClusterAndAppAndUser(c *gin.Context)
- func GetJoinClusterAndAppAndUserDetail(c *gin.Context)
- func GetList(c *gin.Context)
- func GetNsInfo(c *gin.Context)
- func GetV2(c *gin.Context)
- func HasModifyPermissionToSomeDevSpace(userId, devSpaceId uint64) (*model.ClusterUserModel, error)
- func HasPrivilegeToSomeDevSpace(c *gin.Context, devSpaceId uint64) (*model.ClusterUserModel, error)
- func ImportStatus(c *gin.Context)
- func IsShareUsersOk(cooperators, viewers []uint64, clusterUser *model.ClusterUserModel) bool
- func ListAll(c *gin.Context)
- func ListByUserId(c *gin.Context)
- func ListV2(c *gin.Context)
- func LoginUserHasModifyPermissionToSomeDevSpace(c *gin.Context, devSpaceId uint64) (*model.ClusterUserModel, error)
- func NsBatchImport(c *gin.Context)
- func NsImport(c *gin.Context)
- func PipeLine(clusterUsers []*model.ClusterUserV2, userId uint64, isAdmin bool) error
- func PluginReCreate(c *gin.Context)
- func ReCreate(c *gin.Context)
- func Share(c *gin.Context)
- func UnShare(c *gin.Context)
- func Update(c *gin.Context)
- func UpdateMeshDevSpaceInfo(c *gin.Context)
- func UpdateResourceLimit(c *gin.Context)
- func ValidSpaceResourceLimit(resLimit SpaceResourceLimit) (bool, string)
- type BatchImport
- type BatchImportItem
- type ClusterUserCreateRequest
- type ClusterUserGetRequest
- type ClusterUserListQuery
- type ClusterUserListV2Query
- type ClusterUserShareRequest
- type ClusterUserUnShareRequest
- type DevSpace
- type DevSpaceRequest
- type NamespaceInfo
- type NsImportItem
- type NsImportStatus
- type NsImportStatusItem
- type SpaceResourceLimit
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
Create Create dev space @Summary Create dev space @Description Create dev space @Tags DevSpace @Accept json @Produce json @param Authorization header string true "Authorization" @Param CreateAppRequest body cluster_user.ClusterUserCreateRequest true "cluster user info" @Param id path uint64 true "Application ID" @Success 200 {object} model.ClusterUserModel @Router /v1/dev_space/{id} [post]
func Delete ¶
Delete Completely delete the development environment @Summary Completely delete the development environment @Description Completely delete the development environment, including deleting the K8S namespace @Tags DevSpace @Accept json @Produce json @param Authorization header string true "Authorization" @Param id path uint64 true "DevSpace ID" @Success 200 {object} api.Response "{"code":0,"message":"OK","data":null}" @Router /v1/dev_space/{id} [delete]
func DoList ¶
func DoList(params *model.ClusterUserModel, userId uint64, isAdmin, isCanBeUsedAsBaseSpace bool) ( []*model.ClusterUserV2, error)
func GetAppsInfo ¶
GetAppsInfo @Summary Get mesh apps info @Description Get mesh apps info @Tags DevSpace @Accept json @Produce json @param Authorization header string true "Authorization" @Param id path string true "devspace id" @Success 200 {object} setupcluster.MeshDevInfo @Router /v1/dev_space/{id}/mesh_apps_info [get]
func GetDevSpaceDetail ¶
@Summary Get the details of a development environment of the application @Description Get dev space detail from application @Tags Application @Accept json @Produce json @param Authorization header string true "Authorization" @Param id path string true "Application ID" @Param space_id path string true "DevSpace ID" @Success 200 {object} model.ClusterUserModel "Application development environment parameters, including kubeconfig, status=0 application not installed, 1 installed" @Router /v1/application/{id}/dev_space/{space_id}/detail [get]
func GetFirst ¶
@Summary Plug-in Get personal application development environment (kubeconfig) (obsolete) @Description Get personal application development environment (kubeconfig) (obsolete) @Tags Plug-in @Accept json @Produce json @param Authorization header string true "Authorization" @Param id path string true "Application ID" @Success 200 {object} model.ClusterUserModel "Application development environment parameters, including kubeconfig, status=0 application not installed, 1 installed" @Router /v1/application/{id}/dev_space [get]
func GetJoinClusterAndAppAndUser ¶
@Summary Get a list of application development environments @Description Get application dev space list @Tags Application @Accept json @Produce json @param Authorization header string true "Authorization" @Param id path string true "User ID" @Success 200 {object} model.ClusterUserJoinClusterAndAppAndUser "Application development environment parameters, including kubeconfig, status=0 application not installed, 1 installed" @Router /v1/users/{id}/dev_space_list [get]
func GetJoinClusterAndAppAndUserDetail ¶
@Summary Get the details of a development environment of the application @Description Get dev space detail from application @Tags DevSpace @Accept json @Produce json @param Authorization header string true "Authorization" @Param id path string true "DevSpace ID" @Success 200 {object} model.ClusterUserJoinClusterAndAppAndUser "Application development environment parameters, including kubeconfig, status=0 application not installed, 1 installed" @Router /v1/dev_space/{id}/detail [get]
func GetList ¶
@Summary Get a list of application development environments @Description Get application dev space list @Tags Application @Accept json @Produce json @param Authorization header string true "Authorization" @Param id path string true "Application ID" @Success 200 {object} model.ClusterUserModel "Application development environment parameters, including kubeconfig, status=0 application not installed, 1 installed" @Router /v1/application/{id}/dev_space_list [get]
func HasModifyPermissionToSomeDevSpace ¶
func HasModifyPermissionToSomeDevSpace(userId, devSpaceId uint64) (*model.ClusterUserModel, error)
func HasPrivilegeToSomeDevSpace ¶
HasPrivilegeToSomeDevSpace Include - update resource limit - delete devspace
func ImportStatus ¶
func IsShareUsersOk ¶
func IsShareUsersOk(cooperators, viewers []uint64, clusterUser *model.ClusterUserModel) bool
func ListAll ¶
ListAll dev spaces @Summary ListAll dev spaces @Description ListAll dev spaces @Tags DevSpace @Accept json @Produce json @param Authorization header string true "Authorization" @Success 200 {object} model.ClusterUserModel @Router /v1/dev_space/{id} [get]
func LoginUserHasModifyPermissionToSomeDevSpace ¶
func LoginUserHasModifyPermissionToSomeDevSpace(c *gin.Context, devSpaceId uint64) (*model.ClusterUserModel, error)
LoginUserHasModifyPermissionToSomeDevSpace those role can modify the devSpace: - is the cooperator of ns - is nocalhost admin - is owner - is devSpace's cluster owner
func NsBatchImport ¶
func PipeLine ¶
func PipeLine(clusterUsers []*model.ClusterUserV2, userId uint64, isAdmin bool) error
func PluginReCreate ¶
ReCreate Plugin ReCreate devSpace @Summary Plugin ReCreate devSpace @Description Plugin delete devSpace and create a new one @Tags Plug-in @Accept json @Produce json @param Authorization header string true "Authorization" @Param id path uint64 true "DevSpace ID" @Success 200 {object} model.ClusterModel @Router /v1/plugin/{id}/recreate [post]
func ReCreate ¶
ReCreate ReCreate devSpace @Summary ReCreate devSpace @Description delete devSpace and create a new one @Tags DevSpace @Accept json @Produce json @param Authorization header string true "Authorization" @Param id path uint64 true "DevSpace ID" @Success 200 {object} model.ClusterModel @Router /v1/dev_space/{id}/recreate [post]
func Update ¶
Update @Summary Update dev space @Description Update dev space @Tags Cluster @Accept json @Produce json @param Authorization header string true "Authorization" @Param id path string true "devspace id" @Param CreateAppRequest body cluster_user.DevSpaceRequest true "kubeconfig" @Success 200 {object} model.ClusterUserModel @Router /v1/dev_space/{id} [put]
func UpdateMeshDevSpaceInfo ¶
UpdateMeshDevSpaceInfo update mesh dev space info @Summary Update mesh dev space info @Description Update mesh dev space info @Tags DevSpace @Accept json @Produce json @param Authorization header string true "Authorization" @Param id path string true "devspace id" @Param MeshDevInfo body setupcluster.MeshDevInfo true "mesh dev space info" @Success 200 {object} model.ClusterUserModel @Router /v1/dev_space/{id}/update_mesh_dev_space_info [put]
func UpdateResourceLimit ¶
UpdateResourceLimit @Summary UpdateResourceLimit @Description update resource limit in dev space @Tags DevSpace @Accept json @Produce json @param Authorization header string true "Authorization" @Param id path string true "devspace id" @Param SpaceResourceLimit body cluster_user.SpaceResourceLimit true "kubeconfig" @Success 200 {object} model.ClusterUserModel @Router /v1/dev_space/{id}/update_resource_limit [put]
func ValidSpaceResourceLimit ¶
func ValidSpaceResourceLimit(resLimit SpaceResourceLimit) (bool, string)
Types ¶
type BatchImport ¶
type BatchImport struct {
Devspaces []*BatchImportItem `json:"devspaces" yaml:"devspaces"`
}
type BatchImportItem ¶
type ClusterUserCreateRequest ¶
type ClusterUserCreateRequest struct { ID *uint64 `json:"id"` ClusterId *uint64 `json:"cluster_id" binding:"required"` UserId *uint64 `json:"user_id" binding:"required"` SpaceName string `json:"space_name"` Memory *uint64 `json:"memory"` Cpu *uint64 `json:"cpu"` ApplicationId *uint64 `json:"application_id"` ClusterAdmin *uint64 `json:"cluster_admin"` NameSpace string `json:"namespace"` SpaceResourceLimit *SpaceResourceLimit `json:"space_resource_limit"` BaseDevSpaceId uint64 `json:"base_dev_space_id"` MeshDevInfo *setupcluster.MeshDevInfo `json:"mesh_dev_info"` IsBaseSpace bool `json:"is_base_space"` Protected bool `json:"protected"` }
func (*ClusterUserCreateRequest) Validate ¶
func (cu *ClusterUserCreateRequest) Validate() (bool, error)
type ClusterUserGetRequest ¶
type ClusterUserGetRequest struct {
ClusterUserId *uint64 `form:"cluster_user_id" binding:"required"`
}
type ClusterUserListQuery ¶
type ClusterUserListQuery struct {
UserId *uint64 `form:"user_id"`
}
type ClusterUserListV2Query ¶
type ClusterUserShareRequest ¶
type ClusterUserShareRequest struct {}
type ClusterUserUnShareRequest ¶
type ClusterUserUnShareRequest struct {}
type DevSpace ¶
type DevSpace struct { DevSpaceParams ClusterUserCreateRequest KubeConfig []byte // contains filtered or unexported fields }
func NewDevSpace ¶
func NewDevSpace(devSpaceParams ClusterUserCreateRequest, c *gin.Context, kubeConfig []byte) *DevSpace
type DevSpaceRequest ¶
type NamespaceInfo ¶
type NsImportItem ¶
type NsImportStatus ¶
type NsImportStatus struct { Process float32 Items []*NsImportStatusItem }
type NsImportStatusItem ¶
type NsImportStatusItem struct { BatchImportItem Success bool ErrInfo string `json:"errInfo"` }
type SpaceResourceLimit ¶
type SpaceResourceLimit struct { SpaceReqMem string `json:"space_req_mem"` SpaceReqCpu string `json:"space_req_cpu"` SpaceLimitsMem string `json:"space_limits_mem"` SpaceLimitsCpu string `json:"space_limits_cpu"` SpaceLbCount string `json:"space_lb_count"` SpacePvcCount string `json:"space_pvc_count"` SpaceStorageCapacity string `json:"space_storage_capacity"` SpaceEphemeralStorage string `json:"space_ephemeral_storage"` ContainerReqMem string `json:"container_req_mem"` ContainerReqCpu string `json:"container_req_cpu"` ContainerLimitsMem string `json:"container_limits_mem"` ContainerLimitsCpu string `json:"container_limits_cpu"` ContainerEphemeralStorage string `json:"container_ephemeral_storage"` }
func (*SpaceResourceLimit) ResourceLimitIsSet ¶
func (srl *SpaceResourceLimit) ResourceLimitIsSet() bool
func (*SpaceResourceLimit) Validate ¶
func (srl *SpaceResourceLimit) Validate() bool