版本封存
This commit is contained in:
@@ -1,28 +1,32 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// AuthorizationFile 授权文件模型
|
||||
type AuthorizationFile struct {
|
||||
EncryptedHosts []string `json:"encrypted_hosts"` // 加密后的主机信息列表
|
||||
TOTPCode string `json:"totp_code"` // TOTP验证码
|
||||
CurrentTime time.Time `json:"current_time"` // 当前系统时间
|
||||
FirstAuthTime time.Time `json:"first_auth_time"` // 初次授权时间
|
||||
TimeOffset int64 `json:"time_offset"` // 授权时间偏移
|
||||
EncryptedHostMap map[string]HostInfo `json:"encrypted_host_map"` // 加密后的主机信息列表
|
||||
TOTPCode string `json:"totp_code"` // TOTP验证码
|
||||
CurrentTime string `json:"current_time"` // 当前系统时间
|
||||
FirstAuthTime string `json:"first_auth_time"` // 初次授权时间
|
||||
TimeOffset int64 `json:"time_offset"` // 授权时间偏移
|
||||
ProjectNamespace string `json:"project_namespace"` // 项目命名空间
|
||||
EncryptedNamespace string `json:"encrypted_namespace"` // 加密后的项目命名空间 防止信息篡改
|
||||
}
|
||||
|
||||
// AuthorizationCode 授权码模型
|
||||
type AuthorizationCode struct {
|
||||
TOTPCode string `json:"totp_code"` // TOTP验证码
|
||||
CurrentTime time.Time `json:"current_time"` // 当前系统时间
|
||||
EncryptedHosts []string `json:"encrypted_hosts"` // 授权主机的加密字符串列表
|
||||
TOTPCode string `json:"totp_code"` // TOTP验证码
|
||||
CurrentTime string `json:"current_time"` // 当前系统时间
|
||||
EncryptedHostMap map[string]HostInfo `json:"encrypted_host_map"` // 加密后的主机信息列表 防止信息篡改
|
||||
ProjectNamespace string `json:"project_namespace"` // 项目命名空间
|
||||
EncryptedNamespace string `json:"encrypted_namespace"` // 加密后的项目命名空间 防止信息篡改
|
||||
}
|
||||
|
||||
// AuthorizationStorage 授权存储信息
|
||||
type AuthorizationStorage struct {
|
||||
EncryptedCode string `json:"encrypted_code"` // 加密后的授权码
|
||||
FirstAuthTime time.Time `json:"first_auth_time"` // 初次授权时间
|
||||
TimeOffset int64 `json:"time_offset"` // 授权时间偏移
|
||||
AuthorizedHosts []string `json:"authorized_hosts"` // 已授权主机列表
|
||||
SecondTOTPSecret string `json:"second_totp_secret"` // 第二级的totp密钥
|
||||
EncryptedAuthrizationCode string `json:"encrypted_authrization_code"` // 加密后的授权码,防止信息篡改
|
||||
FirstAuthTime string `json:"first_auth_time"` // 初次授权时间
|
||||
TimeOffset int64 `json:"time_offset"` // 授权时间偏移
|
||||
AuthorizedHostMap map[string]HostInfo `json:"authorized_host_map"` // 已授权主机列表
|
||||
SecondTOTPSecret string `json:"second_totp_secret"` // 第二级的totp密钥
|
||||
ProjectNamespace string `json:"project_namespace"` // 项目命名空间
|
||||
EncryptedNamespace string `json:"encrypted_namespace"` // 加密后的项目命名空间 防止信息篡改
|
||||
}
|
||||
|
||||
@@ -2,10 +2,13 @@ package models
|
||||
|
||||
// CPUInfo 结构体用于存储 CPU 信息
|
||||
type CPUInfo struct {
|
||||
ModelName string `json:"model_name"`
|
||||
Cores int `json:"cores"`
|
||||
Architecture string `json:"architecture"`
|
||||
UUID string `json:"uuid"`
|
||||
ModelName string `json:"model_name"`
|
||||
Cores int `json:"cores"`
|
||||
Architecture string `json:"architecture"`
|
||||
Flags []string `json:"flags"`
|
||||
Hypervisor string `json:"hypervisor"`
|
||||
Virtualization string `json:"virtualization"`
|
||||
Frequency string `json:"frequency"`
|
||||
}
|
||||
|
||||
// MemoryInfo holds the memory information.
|
||||
@@ -49,22 +52,21 @@ type MotherboardInfo struct {
|
||||
}
|
||||
|
||||
type SystemInfo struct {
|
||||
MachineID string `json:"machine_id"` // 唯一标识符
|
||||
MachineID string `json:"machine_id"` // 主机唯一标识符
|
||||
MachineSerial string `json:"machine_serial"` // 主机序列号
|
||||
OS OSInfo `json:"os"` // 操作系统
|
||||
KernelVersion string `json:"kernel_version"` // 内核版本
|
||||
NodeName string `json:"node_name"` // 节点名称
|
||||
NodeIP string `json:"node_ip"` // 节点IP
|
||||
}
|
||||
|
||||
type OSInfo struct {
|
||||
Name string `json:"name"`
|
||||
Version string `json:"version"`
|
||||
ID string `json:"id"`
|
||||
IDLike string `json:"id_like"`
|
||||
VersionID string `json:"version_id"`
|
||||
PrettyName string `json:"pretty_name"`
|
||||
HomeURL string `json:"home_url"`
|
||||
SupportURL string `json:"support_url"`
|
||||
BugReportURL string `json:"bug_report_url"`
|
||||
PrivacyURL string `json:"privacy_url"`
|
||||
Name string `json:"name"`
|
||||
Version string `json:"version"`
|
||||
ID string `json:"id"`
|
||||
IDLike string `json:"id_like"`
|
||||
VersionID string `json:"version_id"`
|
||||
PrettyName string `json:"pretty_name"`
|
||||
}
|
||||
|
||||
// HostInfo 主机信息模型
|
||||
@@ -77,12 +79,32 @@ type HostInfo struct {
|
||||
MotherboardInfo MotherboardInfo `json:"motherboard_info"`
|
||||
}
|
||||
|
||||
// EnvInfo 环境信息
|
||||
type EnvInfo struct {
|
||||
K8S_NAMESPACE string `json:"k8s_namespace"` // 环境名称
|
||||
APPLICATION_NAME string `json:"application_name"` // 应用名称
|
||||
CUST_JAVA_OPTS string `json:"cust_java_opts"` // 自定义java参数
|
||||
BIZ_CONFIG_GROUP string `json:"biz_config_group"` // 业务配置组
|
||||
SYS_CONFIG_GROUP string `json:"sys_config_group"` // 系统配置组
|
||||
IMAGE_NAME string `json:"image_name"` // 镜像名称
|
||||
JAVA_VERSION string `json:"java_version"` // java版本
|
||||
GIT_COMMIT string `json:"git_commit"` // git commit
|
||||
GIT_BRANCH string `json:"git_branch"` // git branch
|
||||
NODE_NAME string `json:"node_name"` // 节点名称
|
||||
NODE_IP string `json:"node_ip"` // 节点ip
|
||||
POD_NAME string `json:"pod_name"` // pod名称
|
||||
LIMIT_CPU string `json:"limit_cpu"` // 限制cpu
|
||||
LIMIT_MEMORY string `json:"limit_memory"` // 限制内存
|
||||
REQUEST_CPU string `json:"request_cpu"` // 请求cpu
|
||||
REQUEST_MEMORY string `json:"request_memory"` // 请求内存
|
||||
}
|
||||
|
||||
// HeartbeatRequest 心跳请求
|
||||
type HeartbeatRequest struct {
|
||||
HostInfo HostInfo `json:"host_info"` // 主机信息
|
||||
EnvInfo EnvInfo `json:"env_info"` // 环境信息
|
||||
Timestamp int64 `json:"timestamp"` // 时间戳
|
||||
TOTPCode string `json:"totp_code"` // TOTP验证码
|
||||
AppName string `json:"app_name"` // 应用名称
|
||||
}
|
||||
|
||||
// HeartbeatResponse 心跳响应
|
||||
|
||||
22
cmii-uav-watchdog-common/models/project.go
Normal file
22
cmii-uav-watchdog-common/models/project.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package models
|
||||
|
||||
// Project 项目信息
|
||||
type Project struct {
|
||||
Name string `json:"name" binding:"required"`
|
||||
Namespace string `json:"namespace" binding:"required"`
|
||||
Province string `json:"province"`
|
||||
City string `json:"city"`
|
||||
Domain string `json:"domain"`
|
||||
BusinessMan string `json:"business_man"`
|
||||
MarketMan string `json:"market_man" `
|
||||
TierOneSecret string `json:"tier_one_secret" `
|
||||
TierTwoSecret string `json:"tier_two_secret"`
|
||||
AuthTime string `json:"auth_time"`
|
||||
AuthFilePath string `json:"auth_file_path"`
|
||||
CreateTime string `json:"create_time"`
|
||||
}
|
||||
|
||||
// ProjectPO 项目持久化对象
|
||||
type ProjectPO struct {
|
||||
Project
|
||||
}
|
||||
Reference in New Issue
Block a user