Documentation
¶
Index ¶
- Variables
- func GenerateSaName() string
- func GetDB() *gorm.DB
- func Init() *gorm.DB
- func MigrateDB()
- func WhereBuild(where map[string]interface{}) (whereSQL string, vals []interface{}, err error)
- type ApplicationClusterJoinModel
- type ApplicationClusterModel
- type ApplicationModel
- type ApplicationUserModel
- type CPUStats
- type ClusterList
- type ClusterListVo
- type ClusterModel
- func (cm *ClusterModel) GetClusterId() uint64
- func (cm *ClusterModel) GetClusterName() string
- func (cm *ClusterModel) GetClusterServer() string
- func (cm *ClusterModel) GetExtraApiServer() string
- func (cm *ClusterModel) GetKubeConfig() string
- func (cm *ClusterModel) TableName() string
- func (cm *ClusterModel) Validate() error
- type ClusterPack
- type ClusterUserExt
- type ClusterUserJoinCluster
- type ClusterUserJoinClusterAndAppAndUser
- type ClusterUserModel
- type ClusterUserPluginModel
- type ClusterUserV2
- type FsStats
- type Header
- type LdapModel
- type MemoryStats
- type NodeStats
- type NullType
- type PluginApplicationModel
- type PodReference
- type PodStats
- type PrePullModel
- type Resource
- type RuntimeStats
- type SpaceOwnType
- type SpaceType
- type Summary
- type Token
- type UserBaseModel
- func (u *UserBaseModel) Compare(pwd string) (err error)
- func (u *UserBaseModel) Encrypt() (err error)
- func (u *UserBaseModel) NeedToUpdateProfileInLdap(userName, ldapDN string, admin bool) bool
- func (u *UserBaseModel) TableName() string
- func (u *UserBaseModel) ToUserSimple() *UserSimple
- func (u *UserBaseModel) Validate() error
- type UserInfo
- type UserList
- type UserSimple
- type VersionUpgradeInfo
Constants ¶
This section is empty.
Variables ¶
var DB *gorm.DB
Functions ¶
func GenerateSaName ¶
func GenerateSaName() string
serviceaccount must match DNS-1123 label, capital doesn't allow
func WhereBuild ¶
WhereBuild sql build where see: https://github.com/jinzhu/gorm/issues/2055
Types ¶
type ApplicationClusterJoinModel ¶
type ApplicationClusterJoinModel struct {
ApplicationId uint64 `gorm:"column:application_id" json:"application_id"`
ClusterId uint64 `gorm:"column:cluster_id" json:"cluster_id"`
ClusterName string `gorm:"column:cluster_name" json:"cluster_name"`
ClusterDevSpaceCount uint64 `gorm:"column:dev_space_count" json:"dev_space_count"`
ClusterInfo string `gorm:"column:cluster_info" json:"cluster_info"`
ClusterStatus uint64 `gorm:"column:cluster_status" json:"cluster_status"`
ApplicationClusterCreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
}
ApplicationCluserJoinClusterModel
type ApplicationClusterModel ¶
type ApplicationClusterModel struct {
ID uint64 `gorm:"primary_key;AUTO_INCREMENT;column:id" json:"id"`
ApplicationId uint64 `gorm:"column:application_id;not null" json:"application_id"`
ClusterId uint64 `gorm:"column:cluster_id;not null" json:"cluster_id"`
CreatedAt time.Time `gorm:"column:created_at" json:"-"`
UpdatedAt time.Time `gorm:"column:updated_at" json:"-"`
DeletedAt *time.Time `gorm:"column:deleted_at" json:"-"`
}
ApplicationClusterModel
func (*ApplicationClusterModel) TableName ¶
func (u *ApplicationClusterModel) TableName() string
TableName
func (*ApplicationClusterModel) Validate ¶
func (u *ApplicationClusterModel) Validate() error
Validate the fields.
type ApplicationModel ¶
type ApplicationModel struct {
ID uint64 `gorm:"primary_key;AUTO_INCREMENT;column:id" json:"id"`
Context string `json:"context" gorm:"column:context;not null" binding:"required"`
UserId uint64 `gorm:"column:user_id;not null" json:"user_id"`
CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
UpdatedAt time.Time `gorm:"column:updated_at" json:"-"`
DeletedAt *time.Time `gorm:"column:deleted_at" json:"-"`
UserName string `json:"user_name"`
Public uint8 `json:"public" gorm:"column:public;not null" binding:"required"`
Status uint8 `json:"status" gorm:"column:status;not null" binding:"required"`
Editable uint8 `json:"editable"`
ApplicationType string `json:"application_type"`
}
ApplicationModel
func (*ApplicationModel) FillApplicationType ¶
func (u *ApplicationModel) FillApplicationType(ApplicationType string)
func (*ApplicationModel) FillEditable ¶
func (u *ApplicationModel) FillEditable(admin bool, currentUser uint64)
func (*ApplicationModel) FillUserName ¶
func (u *ApplicationModel) FillUserName(usrName string)
func (*ApplicationModel) Validate ¶
func (u *ApplicationModel) Validate() error
Validate the fields.
type ApplicationUserModel ¶
type ApplicationUserModel struct {
ID uint64 `gorm:"primary_key;AUTO_INCREMENT;column:id" json:"id"`
ApplicationId uint64 `gorm:"column:application_id;UNIQUE_INDEX:uidx_userapp;not null" json:"application_id"`
UserId uint64 `gorm:"column:user_id;UNIQUE_INDEX:uidx_userapp;not null" json:"user_id"`
CreatedAt time.Time `gorm:"column:created_at" json:"-"`
UpdatedAt time.Time `gorm:"column:updated_at" json:"-"`
DeletedAt *time.Time `gorm:"column:deleted_at" json:"-"`
}
ApplicationClusterModel
func (*ApplicationUserModel) TableName ¶
func (u *ApplicationUserModel) TableName() string
TableName
func (*ApplicationUserModel) Validate ¶
func (u *ApplicationUserModel) Validate() error
Validate the fields.
type CPUStats ¶
type CPUStats struct {
// The time at which these stats were updated.
Time metav1.Time `json:"time"`
// Total CPU usage (sum of all cores) averaged over the sample window.
// The "core" unit can be interpreted as CPU core-nanoseconds per second.
// +optional
UsageNanoCores uint64 `json:"usageNanoCores,omitempty"`
// Cumulative CPU usage (sum of all cores) since object creation.
// +optional
UsageCoreNanoSeconds uint64 `json:"usageCoreNanoSeconds,omitempty"`
}
CPUStats contains data about CPU usage.
type ClusterList ¶
type ClusterList struct {
ID uint64 `gorm:"column:id" json:"id"`
ClusterName string `gorm:"column:name" json:"name"`
UsersCount uint64 `gorm:"column:users_count" json:"users_count"`
KubeConfig string `gorm:"column:kubeconfig" json:"-"`
StorageClass string `json:"storage_class" gorm:"column:storage_class;not null"`
Info string `gorm:"column:info" json:"info"`
UserId uint64 `gorm:"column:user_id;not null" json:"user_id"`
CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
IsReady bool `json:"is_ready"`
NotReadyMessage string `json:"not_ready_message"`
HasDevSpace bool `json:"has_dev_space"`
Server string `gorm:"column:server;not null" json:"server"`
ExtraApiServer string `gorm:"column:extra_api_server" json:"extra_api_server"`
Modifiable bool `json:"modifiable"`
}
func (*ClusterList) GetClusterId ¶
func (cl *ClusterList) GetClusterId() uint64
func (*ClusterList) GetClusterName ¶
func (cl *ClusterList) GetClusterName() string
func (*ClusterList) GetClusterServer ¶
func (cl *ClusterList) GetClusterServer() string
func (*ClusterList) GetExtraApiServer ¶
func (cl *ClusterList) GetExtraApiServer() string
func (*ClusterList) GetKubeConfig ¶
func (cl *ClusterList) GetKubeConfig() string
type ClusterListVo ¶
type ClusterListVo struct {
ClusterList
Resources []Resource `json:"resources"`
// the user create the cluster
UserName string `json:"user_name"`
}
type ClusterModel ¶
type ClusterModel struct {
ID uint64 `gorm:"primary_key;AUTO_INCREMENT;column:id" json:"id"`
Name string `json:"name" gorm:"column:name;not null" binding:"required" validate:"min=1,max=32"`
Info string `json:"info" gorm:"column:info;"`
UserId uint64 `gorm:"column:user_id;not null" json:"user_id"`
Server string `gorm:"column:server;not null" json:"server"`
ExtraApiServer string `gorm:"column:extra_api_server" json:"extra_api_server"`
KubeConfig string `json:"kubeconfig" gorm:"column:kubeconfig;not null" binding:"required"`
StorageClass string `json:"storage_class" gorm:"column:storage_class;not null;type:VARCHAR(100);comment:'empty means use default storage class'"`
CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
UpdatedAt time.Time `gorm:"column:updated_at" json:"-"`
DeletedAt *time.Time `gorm:"column:deleted_at" json:"-"`
}
ClusterModel
func (*ClusterModel) GetClusterId ¶
func (cm *ClusterModel) GetClusterId() uint64
func (*ClusterModel) GetClusterName ¶
func (cm *ClusterModel) GetClusterName() string
func (*ClusterModel) GetClusterServer ¶
func (cm *ClusterModel) GetClusterServer() string
func (*ClusterModel) GetExtraApiServer ¶
func (cm *ClusterModel) GetExtraApiServer() string
func (*ClusterModel) GetKubeConfig ¶
func (cm *ClusterModel) GetKubeConfig() string
type ClusterPack ¶
type ClusterUserExt ¶
type ClusterUserExt struct {
ClusterName string `json:"cluster_name"`
SpaceType SpaceType `json:"space_type"`
SpaceOwnType SpaceOwnType `json:"space_own_type"`
ResourceLimitSet bool `json:"resource_limit_set"`
CooperUser []*UserSimple `json:"cooper_user"`
ViewerUser []*UserSimple `json:"viewer_user"`
Owner *UserSimple `json:"owner"`
Modifiable bool `json:"modifiable"`
Deletable bool `json:"deletable"`
BaseDevSpaceName string `json:"base_dev_space_name"`
BaseDevSpaceNameSpace string `json:"base_dev_space_namespace"`
}
type ClusterUserJoinCluster ¶
type ClusterUserJoinCluster struct {
ID uint64 `gorm:"column:id" json:"id"`
UserId uint64 `gorm:"column:user_id" json:"user_id"`
ApplicationId uint64 `gorm:"column:application_id" json:"application_id"`
ClusterId uint64 `gorm:"column:cluster_id" json:"cluster_id"`
Namespace string `gorm:"column:namespace" json:"namespace"`
AdminClusterName string `gorm:"column:admin_cluster_name" json:"admin_cluster_name"`
AdminClusterKubeConfig string `gorm:"column:admin_cluster_kubeconfig" json:"admin_cluster_kubeconfig"`
}
type ClusterUserJoinClusterAndAppAndUser ¶
type ClusterUserJoinClusterAndAppAndUser struct {
ID uint64 `gorm:"column:id" json:"id"`
UserId uint64 `gorm:"column:user_id" json:"user_id"`
UserName string `gorm:"column:user_name" json:"user_name"`
SpaceName string `gorm:"column:space_name" json:"space_name"`
ClusterAdmin *uint64 `gorm:"column:cluster_admin;default:0" json:"cluster_admin"`
ClusterId uint64 `gorm:"column:cluster_id" json:"cluster_id"`
ClusterName string `gorm:"column:cluster_name" json:"cluster_name"`
KubeConfig string `gorm:"column:kubeconfig" json:"kubeconfig"`
SpaceResourceLimit string `gorm:"cloumn:space_resource_limit" json:"space_resource_limit"`
Namespace string `gorm:"column:namespace" json:"namespace"`
Status *uint64 `gorm:"column:status" json:"status"`
CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
}
type ClusterUserModel ¶
type ClusterUserModel struct {
ID uint64 `gorm:"primary_key;AUTO_INCREMENT;column:id" json:"id"`
// Deprecated
ApplicationId uint64 `gorm:"column:application_id;not null" json:"application_id"`
UserId uint64 `gorm:"column:user_id;not null" json:"user_id"`
SpaceName string `gorm:"column:space_name;not null;type:VARCHAR(100);comment:'default is application[username]'" json:"space_name"`
ClusterId uint64 `gorm:"column:cluster_id;not null" json:"cluster_id"`
KubeConfig string `gorm:"column:kubeconfig;not null" json:"kubeconfig"`
Memory uint64 `gorm:"column:memory;not null" json:"memory"`
Cpu uint64 `gorm:"column:cpu;not null" json:"cpu"`
SpaceResourceLimit string `gorm:"column:space_resource_limit;type:VARCHAR(1024);" json:"space_resource_limit"`
Namespace string `gorm:"column:namespace;not null" json:"namespace"`
Status *uint64 `gorm:"column:status;default:0" json:"status"`
ClusterAdmin *uint64 `gorm:"column:cluster_admin;default:0" json:"cluster_admin"`
Protected bool `gorm:"column:protected;default:false" json:"protected"`
IsBaseSpace bool `gorm:"column:is_base_space;default:false" json:"is_base_space"`
BaseDevSpaceId uint64 `gorm:"column:base_dev_space_id;default:0" json:"base_dev_space_id"`
TraceHeader Header `gorm:"cloumn:trace_header;type:VARCHAR(256);" json:"trace_header"`
CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
UpdatedAt time.Time `gorm:"column:updated_at" json:"-"`
DeletedAt *time.Time `gorm:"column:deleted_at" json:"-"`
}
ClusterUserModel
func (*ClusterUserModel) IsClusterAdmin ¶
func (cu *ClusterUserModel) IsClusterAdmin() bool
func (*ClusterUserModel) Validate ¶
func (u *ClusterUserModel) Validate() error
Validate the fields.
type ClusterUserPluginModel ¶
type ClusterUserPluginModel struct {
ID uint64 `gorm:"primary_key;AUTO_INCREMENT;column:id" json:"id"`
// Deprecated
ApplicationId uint64 `gorm:"column:application_id;not null" json:"application_id"`
UserId uint64 `gorm:"column:user_id;not null" json:"user_id"`
SpaceName string `gorm:"column:space_name;not null;type:VARCHAR(100);comment:'default is application[username]'" json:"space_name"`
ClusterId uint64 `gorm:"column:cluster_id;not null" json:"cluster_id"`
KubeConfig string `gorm:"column:kubeconfig;not null" json:"kubeconfig"`
Memory uint64 `gorm:"column:memory;not null" json:"memory"`
Cpu uint64 `gorm:"column:cpu;not null" json:"cpu"`
SpaceResourceLimit string `gorm:"cloumn:space_resource_limit;type:VARCHAR(1024);" json:"space_resource_limit"`
Namespace string `gorm:"column:namespace;not null" json:"namespace"`
Status *uint64 `gorm:"column:status;default:0" json:"status"`
CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
UpdatedAt time.Time `gorm:"column:updated_at" json:"-"`
DeletedAt *time.Time `gorm:"column:deleted_at" json:"-"`
DevStartAppendCommand []string `json:"dev_start_append_command"`
// from clusters
StorageClass string `json:"storage_class" gorm:"column:storage_class"`
}
type ClusterUserV2 ¶
type ClusterUserV2 struct {
// Intrinsic field
ID uint64 `gorm:"primary_key;AUTO_INCREMENT;column:id" json:"id"`
UserId uint64 `gorm:"column:user_id;not null" json:"user_id"`
ClusterAdmin *uint64 `gorm:"column:cluster_admin;default:0" json:"cluster_admin"`
Namespace string `gorm:"column:namespace;not null" json:"namespace"`
SpaceName string `gorm:"column:space_name;not null;type:VARCHAR(100);comment:'default is application[username]'" json:"space_name"`
ClusterId uint64 `gorm:"column:cluster_id;not null" json:"cluster_id"`
IsBaseSpace bool `gorm:"column:is_base_space;default:false" json:"is_base_space"`
BaseDevSpaceId uint64 `gorm:"column:base_dev_space_id;default:0" json:"base_dev_space_id"`
TraceHeader Header `gorm:"cloumn:trace_header;type:VARCHAR(256);" json:"trace_header"`
SpaceResourceLimit string `gorm:"column:space_resource_limit;type:VARCHAR(1024);" json:"space_resource_limit"`
CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
// ext field
*ClusterUserExt
}
func (*ClusterUserV2) IsClusterAdmin ¶
func (cu *ClusterUserV2) IsClusterAdmin() bool
type FsStats ¶
type FsStats struct {
// The time at which these stats were updated.
Time metav1.Time `json:"time"`
// AvailableBytes represents the storage space available (bytes) for the filesystem.
// +optional
AvailableBytes uint64 `json:"availableBytes,omitempty"`
// CapacityBytes represents the total capacity (bytes) of the filesystems underlying storage.
// +optional
CapacityBytes uint64 `json:"capacityBytes,omitempty"`
// UsedBytes represents the bytes used for a specific task on the filesystem.
// This may differ from the total bytes used on the filesystem and may not equal CapacityBytes - AvailableBytes.
// e.g. For ContainerStats.Rootfs this is the bytes used by the container rootfs on the filesystem.
// +optional
UsedBytes uint64 `json:"usedBytes,omitempty"`
// InodesFree represents the free inodes in the filesystem.
// +optional
InodesFree uint64 `json:"inodesFree,omitempty"`
// Inodes represents the total inodes in the filesystem.
// +optional
Inodes uint64 `json:"inodes,omitempty"`
// InodesUsed represents the inodes used by the filesystem
// This may not equal Inodes - InodesFree because this filesystem may share inodes with other "filesystems"
// e.g. For ContainerStats.Rootfs, this is the inodes used only by that container, and does not count inodes used by other containers.
InodesUsed uint64 `json:"inodesUsed,omitempty"`
}
FsStats contains data about filesystem usage.
type Header ¶
type LdapModel ¶
type LdapModel struct {
ID uint64 `gorm:"primary_key;AUTO_INCREMENT;column:id" json:"id"`
Server string `gorm:"column:server" json:"server"`
Tls *uint64 `gorm:"column:tls;default:0" json:"tls"`
Md5 *uint64 `gorm:"column:md5;default:0" json:"md5"`
BindDn string `gorm:"column:bind_dn" json:"bind_dn"`
Password string `gorm:"column:password" json:"password"`
BaseDn string `gorm:"column:base_dn" json:"base_dn"`
Filter string `gorm:"column:filter" json:"filter"`
AdminBaseDn string `gorm:"column:admin_base_dn" json:"admin_base_dn"`
AdminFilter string `gorm:"column:admin_filter" json:"admin_filter"`
EmailAttr string `gorm:"column:email_attr" json:"email_attr"`
UserNameAttr string `gorm:"column:user_name_attr" json:"user_name_attr"`
Enable *uint64 `gorm:"column:enable" json:"enable"`
CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
UpdatedAt time.Time `gorm:"column:updated_at" json:"-"`
DeletedAt *time.Time `gorm:"column:deleted_at" json:"-"`
// sync gen use to mark user as unavailable
SyncGen uint64 `gorm:"column:ldap_gen" json:"ldap_gen"`
// sync protection ts use to lock the ldap sync cron job
SyncProtectionTs int64 `gorm:"column:sync_protection_ts" json:"sync_protection_ts"`
// if err occur when last sync, record it
LastSyncErrMsg string `gorm:"column:last_sync_err_msg" json:"last_sync_err_msg"`
Entries int `gorm:"column:entries" json:"entries"`
Inserts int `gorm:"column:inserts" json:"inserts"`
Updates int `gorm:"column:updates" json:"updates"`
Deletes int `gorm:"column:deletes" json:"deletes"`
Fails int `gorm:"column:fails" json:"fails"`
Costs int64 `gorm:"column:costs" json:"costs"`
}
type MemoryStats ¶
type MemoryStats struct {
// The time at which these stats were updated.
Time metav1.Time `json:"time"`
// Available memory for use. This is defined as the memory limit - workingSetBytes.
// If memory limit is undefined, the available bytes is omitted.
// +optional
AvailableBytes uint64 `json:"availableBytes,omitempty"`
// Total memory in use. This includes all memory regardless of when it was accessed.
// +optional
UsageBytes uint64 `json:"usageBytes,omitempty"`
// The amount of working set memory. This includes recently accessed memory,
// dirty memory, and kernel memory. WorkingSetBytes is <= UsageBytes
// +optional
WorkingSetBytes uint64 `json:"workingSetBytes,omitempty"`
// The amount of anonymous and swap cache memory (includes transparent
// hugepages).
// +optional
RSSBytes uint64 `json:"rssBytes,omitempty"`
// Cumulative number of minor page faults.
// +optional
PageFaults uint64 `json:"pageFaults,omitempty"`
// Cumulative number of major page faults.
// +optional
MajorPageFaults uint64 `json:"majorPageFaults,omitempty"`
}
MemoryStats contains data about memory usage.
type NodeStats ¶
type NodeStats struct {
// Reference to the measured Node.
NodeName string `json:"nodeName"`
// Stats pertaining to CPU resources.
// +optional
CPU CPUStats `json:"cpu,omitempty"`
// Stats pertaining to memory (RAM) resources.
// +optional
Memory MemoryStats `json:"memory,omitempty"`
// Stats pertaining to total usage of filesystem resources on the rootfs used by node k8s components.
// NodeFs.Used is the total bytes used on the filesystem.
// +optional
Fs FsStats `json:"fs,omitempty"`
// Stats about the underlying container runtime.
// +optional
Runtime RuntimeStats `json:"runtime,omitempty"`
}
NodeStats holds node-level unprocessed sample stats.
type NullType ¶
type NullType byte
NullType
const ( // IsNull the same as `is null` IsNull NullType // IsNotNull the same as `is not null` IsNotNull )
type PluginApplicationModel ¶
type PluginApplicationModel struct {
ID uint64 `gorm:"column:id" json:"id"`
Context string `json:"context" gorm:"column:context"`
UserId uint64 `gorm:"column:user_id" json:"-"`
Status uint64 `json:"status" gorm:"column:status"`
Public uint8 `json:"public" gorm:"column:public"`
ClusterId uint64 `json:"cluster_id" gorm:"column:cluster_id"`
SpaceName string `json:"space_name" gorm:"column:space_name"`
KubeConfig string `json:"kubeconfig" gorm:"column:kubeconfig"`
StorageClass string `json:"storage_class" gorm:"column:storage_class"`
Memory uint64 `json:"memory" gorm:"column:memory"`
Cpu uint64 `json:"cpu" gorm:"column:cpu"`
NameSpace string `json:"namespace" gorm:"column:namespace"`
InstallStatus uint64 `json:"install_status" gorm:"column:install_status"`
DevSpaceId uint64 `json:"devspace_id" gorm:"column:devspace_id"`
DevStartAppendCommand string `json:"dev_start_append_command"`
}
type PodReference ¶
PodReference contains enough information to locate the referenced pod.
type PodStats ¶
type PodStats struct {
// Reference to the measured Pod.
PodRef PodReference `json:"podRef"`
// Stats pertaining to CPU resources consumed by pod cgroup (which includes all containers' resource usage and pod overhead).
// +optional
CPU *CPUStats `json:"cpu,omitempty"`
// Stats pertaining to memory (RAM) resources consumed by pod cgroup (which includes all containers' resource usage and pod overhead).
// +optional
Memory *MemoryStats `json:"memory,omitempty"`
// EphemeralStorage reports the total filesystem usage for the containers and emptyDir-backed volumes in the measured Pod.
// +optional
EphemeralStorage *FsStats `json:"ephemeral-storage,omitempty"`
}
PodStats holds pod-level unprocessed sample stats.
type PrePullModel ¶
type PrePullModel struct {
ID uint64 `gorm:"primary_key;AUTO_INCREMENT;column:id" json:"id"`
Images string `gorm:"column:images;not null" json:"images"`
DeletedAt *time.Time `gorm:"column:deleted_at" json:"-"`
}
PrePullModel
type Resource ¶
type Resource struct {
ResourceName v1.ResourceName `json:"resource_name"`
Capacity float64 `json:"capacity"`
Used float64 `json:"used"`
Percentage float64 `json:"percentage"`
}
type RuntimeStats ¶
type RuntimeStats struct {
// Stats about the underlying filesystem where container images are stored.
// This filesystem could be the same as the primary (root) filesystem.
// Usage here refers to the total number of bytes occupied by images on the filesystem.
// +optional
ImageFs FsStats `json:"imageFs,omitempty"`
}
RuntimeStats are stats pertaining to the underlying container runtime.
type SpaceOwnType ¶
var DevSpaceOwnTypeCooperator SpaceOwnType = SpaceOwnType{"Cooperator", 100}
var DevSpaceOwnTypeOwner SpaceOwnType = SpaceOwnType{"Owner", 1000}
var DevSpaceOwnTypeViewer SpaceOwnType = SpaceOwnType{"Viewer", 10}
var None SpaceOwnType = SpaceOwnType{"None", 1}
type Summary ¶
type Summary struct {
// Overall node stats.
Node NodeStats `json:"node"`
// Per-pod stats.
Pods []PodStats `json:"pods"`
}
Summary is a top-level container for holding NodeStats and PodStats.
type UserBaseModel ¶
type UserBaseModel struct {
ID uint64 `gorm:"primary_key;AUTO_INCREMENT;column:id" json:"id"`
Uuid string `gorm:"column:uuid;not null" json:"-"`
SaName string `gorm:"column:sa_name" json:"sa_name"`
Name string `json:"name" gorm:"column:name;not null" json:"name"`
Username string `json:"username" gorm:"column:username;not null" validate:"min=1,max=32"`
Password string `json:"-" gorm:"column:password;not null" binding:"required" validate:"min=5,max=128"`
Phone int64 `gorm:"column:phone" json:"phone"`
Email string `gorm:"column:email" json:"email"`
LdapDN string `gorm:"column:ldap_dn" json:"ldap_dn"`
LdapGen uint64 `gorm:"column:ldap_gen" json:"ldap_gen"`
IsAdmin *uint64 `gorm:"column:is_admin" json:"is_admin"`
Status *uint64 `gorm:"column:status" json:"status"`
ClusterAdmin *uint64 `gorm:"column:cluster_admin" json:"cluster_admin"`
Avatar string `gorm:"column:avatar" json:"avatar"`
CreatedAt time.Time `gorm:"column:created_at" json:"-"`
UpdatedAt time.Time `gorm:"column:updated_at" json:"-"`
DeletedAt *time.Time `gorm:"column:deleted_at" json:"-"`
}
UserBaseModel
func (*UserBaseModel) Compare ¶
func (u *UserBaseModel) Compare(pwd string) (err error)
Compare with the plain text password. Returns true if it's the same as the encrypted one (in the `User` struct).
func (*UserBaseModel) Encrypt ¶
func (u *UserBaseModel) Encrypt() (err error)
Encrypt the user password.
func (*UserBaseModel) NeedToUpdateProfileInLdap ¶
func (u *UserBaseModel) NeedToUpdateProfileInLdap(userName, ldapDN string, admin bool) bool
func (*UserBaseModel) ToUserSimple ¶
func (u *UserBaseModel) ToUserSimple() *UserSimple
Validate the fields.
type UserInfo ¶
type UserInfo struct {
ID uint64 `json:"id"`
Username string `json:"username"`
Avatar string `json:"avatar"`
Email int `json:"email"`
Status uint64 `json:"status"`
}
UserInfo
type UserList ¶
type UserList struct {
ID uint64 `gorm:"column:id" json:"id"`
Name string `gorm:"column:name" json:"name"`
SaName string `gorm:"column:sa_name;not null" json:"sa_ame"`
Email string `gorm:"column:email" json:"email"`
ClusterCount uint64 `gorm:"column:cluster_count" json:"cluster_count"`
Status uint64 `gorm:"column:status" json:"status"`
IsAdmin uint64 `gorm:"column:is_admin" json:"is_admin"`
}
UserList
type UserSimple ¶
type UserSimple struct {
ID uint64 `gorm:"primary_key;AUTO_INCREMENT;column:id" json:"id"`
Name string `json:"name" gorm:"column:name;not null" json:"name"`
Username string `json:"username" gorm:"column:username;not null" validate:"min=1,max=32"`
Phone int64 `gorm:"column:phone" json:"phone"`
Email string `gorm:"column:email" json:"email"`
IsAdmin *uint64 `gorm:"column:is_admin" json:"is_admin"`
Status *uint64 `gorm:"column:status" json:"status"`
ClusterAdmin *uint64 `gorm:"column:cluster_admin" json:"cluster_admin"`
Avatar string `gorm:"column:avatar" json:"avatar"`
CreatedAt time.Time `gorm:"column:created_at" json:"-"`
}