- Instance deployment: charts browser, deploy modal, instances list - Values Template version management (create/history/rollback) - Storage layered config (cluster > workspace > shared priority) - Cluster credential decryptIfNeeded for mixed encrypted/plaintext kubeconfig - YAML syntax validation (client-side + server-side warning) - Frontend: charts, instances, storage, templates, admin pages - Backend: storage service, instance service, cluster service, helm client - Multi-Tenant Kubeconfig.md: added by user
37 lines
754 B
Go
37 lines
754 B
Go
package entity
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
// Workspace 工作空间实体
|
|
type Workspace struct {
|
|
ID string
|
|
Name string
|
|
Description string
|
|
ClusterIDs []string // 关联的集群 ID 列表
|
|
CreatedBy string // 创建者用户 ID
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
// NewWorkspace 创建新工作空间
|
|
func NewWorkspace(name, description, createdBy string, clusterIDs []string) *Workspace {
|
|
now := time.Now()
|
|
return &Workspace{
|
|
Name: name,
|
|
Description: description,
|
|
ClusterIDs: clusterIDs,
|
|
CreatedBy: createdBy,
|
|
CreatedAt: now,
|
|
UpdatedAt: now,
|
|
}
|
|
}
|
|
|
|
// Validate 验证工作空间数据
|
|
func (w *Workspace) Validate() error {
|
|
if w.Name == "" {
|
|
return ErrInvalidWorkspaceName
|
|
}
|
|
return nil
|
|
} |