Documentation
¶
Index ¶
- Constants
- type Cluster
- type ClusterIds
- type CreateRoleRequest
- type DeleteUsersRequest
- type LocalTime
- type LoginUser
- type Mode
- type NodeStatus
- type PageResult
- type PaginationQ
- type Role
- type RolePermission
- type SystemSafeSettingsRequest
- type SystemSettings
- type User
- type UserRequest
- type UsersChangePasswordRequest
- type UsersListResponse
Constants ¶
View Source
const ( SecLocalTimeFormat = "2023-02-02 15:04:05" DateLocalTimeFormat = "2023-02-02" )
View Source
const ( DefaultPage = 1 DefaultPageSize = 15 )
Default values for page and page size
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct {
Mode
ClusterName string `json:"clusterName" gorm:"comment:clusterName" binding:"required"`
KubeConfig string `json:"kubeConfig" gorm:"comment:clusterCertificate;type:varchar(15360)" binding:"required"`
NodeCount int `json:"nodeCount" gorm:"comment:cluster node counts"`
ClusterVersion string `json:"clusterVersion" gorm:"cluster version"`
}
type ClusterIds ¶
type ClusterIds struct {
Data interface{} `json:"clusterIds"`
}
type CreateRoleRequest ¶
type DeleteUsersRequest ¶
type DeleteUsersRequest struct {
Ids []int `json:"ids"`
}
type LocalTime ¶
func (LocalTime) DateString ¶
func (LocalTime) MarshalJSON ¶
func (*LocalTime) UnmarshalJSON ¶
type Mode ¶
type NodeStatus ¶
type NodeStatus struct {
NodeCount int `json:"node_count"`
Ready int `json:"ready"`
UnReady int `json:"unready"`
Namespace int `json:"namespace"`
Deployment int `json:"deployment"`
Pod int `json:"pod"`
CpuUsage float64 `json:"cpu_usage" desc:"cpu usage"`
CpuCore float64 `json:"cpu_core"`
CpuCapacityCore float64 `json:"cpu_capacity_core"`
MemoryUsage float64 `json:"memory_usage" desc:"memory usage"`
MemoryUsed float64 `json:"memory_used"`
MemoryTotal float64 `json:"memory_total"`
}
type PageResult ¶
type PageResult struct {
Items interface{} `form:"items" json:"items"` // Items holds the paginated data.
Total int64 `form:"total" json:"total"` // Total is the total number of items.
Page int `form:"page" json:"page"` // Page is the current page number.
PageSize int `form:"pageSize" json:"pageSize"` // PageSize is the number of items per page.
}
func SetPageDefaults ¶
func SetPageDefaults(p *PageResult) (page *PageResult, offset int)
type PaginationQ ¶
type Role ¶
type Role struct {
Mode
Name string `gorm:"column:name;comment:'role name';size:256" json:"name"`
Desc string `gorm:"column:desc;comment:'role description';size:256" json:"desc"`
Code string `gorm:"column:name;comment:'role code';size:256" json:"code"`
Users []User `gorm:"foreignkey:RoleId" json:"users"`
PermissionId int `gorm:"column:permission_id;comment:'Permission id Foreign key'" json:"permission_id"`
Permission []RolePermission `gorm:"foreignkey:PermissionId" json:"permission"`
}
type RolePermission ¶
type RolePermission struct {
Mode
RoleId int `gorm:"column:role_id;comment:'role id'" json:"role_id"`
PermissionId int `gorm:"column:permission_id;comment:'permission id'" json:"permission_id"`
}
func (RolePermission) TableName ¶
func (m RolePermission) TableName() string
type SystemSettings ¶
type SystemSettings struct {
Mode
LoginFail int `gorm:"column:login_fail;default:3;comment:Limit the number of login failures" json:"loginFail"`
LockTime int `gorm:"column:lock_time;default:30;comment:Login lock duration (zw)" json:"lockTime"`
PasswordExpire int `` /* 138-byte string literal not displayed */
}
func (SystemSettings) TableName ¶
func (system SystemSettings) TableName() string
type User ¶
type User struct {
Mode
UID string `gorm:"column:uid;comment:'user uid'" json:"uid"`
UserName string `gorm:"column:username;comment:'user name'" json:"username",binding:"required"`
Password string `gorm:"column:password;comment:'user password'" json:"password",binding:"required"`
Status *bool `gorm:"type:tinyint(1);default:true;comment:'user status(enable/disable)'"`
RoleId uint `gorm:"column:role_id;comment:'role foreign id'" json:"role_id"`
Role Role `gorm:"foreignkey:RoleId" json:"role"`
}
type UserRequest ¶
type UsersListResponse ¶
Click to show internal directories.
Click to hide internal directories.