Documentation
¶
Index ¶
- type ChangePasswordRequest
- type ClusterListResponse
- type ClusterResponse
- type CreateClusterRequest
- type CreateUserRequest
- type CreateUserResponse
- type LoginRequest
- type LoginResponse
- type RegisterRequest
- type ResourceSummary
- type UpdateClusterRequest
- type UpdateProfileRequest
- type User
- type UserResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChangePasswordRequest ¶ added in v0.1.3
type ClusterListResponse ¶ added in v0.3.1
type ClusterResponse ¶ added in v0.3.1
type ClusterResponse struct { ID string `json:"id"` Name string `json:"name"` Provider string `json:"provider"` Description string `json:"description"` Environment string `json:"environment"` Region string `json:"region"` Version string `json:"version"` Status string `json:"status"` Source string `json:"source"` Labels map[string]string `json:"labels"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
type CreateClusterRequest ¶ added in v0.3.1
type CreateClusterRequest struct { Name string `json:"name" binding:"required"` KubeconfigData string `json:"kubeconfigData" binding:"required"` // Base64 编码的 kubeconfig 字符串 Provider string `json:"provider"` Description string `json:"description"` Environment string `json:"environment"` Region string `json:"region"` }
type CreateUserRequest ¶ added in v0.1.2
type CreateUserResponse ¶ added in v0.1.2
type LoginRequest ¶ added in v0.1.2
type LoginRequest struct { Username string `json:"username" binding:"required,min=3,max=50"` Password string `json:"password" binding:"required,min=6"` }
LoginRequest
type LoginResponse ¶ added in v0.1.2
type LoginResponse struct { Token string `json:"token"` ExpiresAt time.Time `json:"expires_at"` User UserResponse `json:"user"` }
type RegisterRequest ¶ added in v0.1.3
type RegisterRequest struct { Username string `json:"username" binding:"required,min=3,max=50"` Email string `json:"email" binding:"required,email"` Password string `json:"password" binding:"required,min=6"` }
LoginResponse 登录成功后返回 jwt token
type ResourceSummary ¶
type ResourceSummary struct { Nodes *int `json:"nodes"` Namespaces *int `json:"namespaces"` Pods *int `json:"pods"` Deployments *int `json:"deployments"` Services *int `json:"services"` PersistentVolumes *int `json:"persistentVolumes"` Pvcs *int `json:"pvcs"` // PersistentVolumeClaims StatefulSets *int `json:"statefulSets"` DaemonSets *int `json:"daemonSets"` ConfigMaps *int `json:"configMaps"` Secrets *int `json:"secrets"` Ingresses *int `json:"ingresses"` }
ResourceSummary represents the count of various cluster resources. Use pointers to distinguish between a count of 0 and a failure to retrieve count.
type UpdateClusterRequest ¶ added in v0.3.1
type UpdateClusterRequest struct { Name string `json:"name"` Provider string `json:"provider"` Description string `json:"description"` Environment string `json:"environment"` Region string `json:"region"` Status string `json:"status"` Labels map[string]string `json:"labels"` KubeconfigData string `json:"kubeconfigData,omitempty"` }
type UpdateProfileRequest ¶ added in v0.1.3
type UpdateProfileRequest struct {
Email string `json:"email" binding:"required,email"`
}
type User ¶ added in v0.1.2
type User struct { ID uint `json:"id" gorm:"primaryKey"` Username string `json:"username" gorm:"uniqueIndex;not null;size:50"` Email string `json:"email" gorm:"uniqueIndex;not null;size:100"` Password string `json:"-" gorm:"not null"` Role string `json:"role" gorm:"default:user;size:20"` IsActive bool `json:"is_active" gorm:"default:true"` LastLogin *time.Time `json:"last_login"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` DeletedAt gorm.DeletedAt `json:"-" gorm:"index"` }
User 用户模型
func (*User) BeforeCreate ¶ added in v0.1.3
BeforeCreate GORM钩子:创建前加密密码
func (*User) CheckPassword ¶ added in v0.1.3
CheckPassword 验证密码
func (*User) ToResponse ¶ added in v0.1.3
func (u *User) ToResponse() UserResponse
ToResponse 转换为响应格式
Click to show internal directories.
Click to hide internal directories.