Documentation
¶
Index ¶
- func AddInnerMCPServer() error
- func AutoMigrate() error
- func FixClusterAuthorizationTypeName() error
- func FixClusterName() error
- func FixRoleName() error
- func InitConditionTable() error
- func InitConfigTable() error
- type ApiKey
- func (c *ApiKey) Delete(params *dao.Params, ids string, queryFuncs ...func(*gorm.DB) *gorm.DB) error
- func (c *ApiKey) GetOne(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) (*ApiKey, error)
- func (c *ApiKey) List(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) ([]*ApiKey, int64, error)
- func (c *ApiKey) Save(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) error
- type ClusterUserRole
- func (c *ClusterUserRole) Delete(params *dao.Params, ids string, queryFuncs ...func(*gorm.DB) *gorm.DB) error
- func (c *ClusterUserRole) GetOne(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) (*ClusterUserRole, error)
- func (c *ClusterUserRole) List(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) ([]*ClusterUserRole, int64, error)
- func (c *ClusterUserRole) Save(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) error
- type ConditionReverse
- func (c *ConditionReverse) Delete(params *dao.Params, ids string, queryFuncs ...func(*gorm.DB) *gorm.DB) error
- func (c *ConditionReverse) GetOne(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) (*ConditionReverse, error)
- func (c *ConditionReverse) List(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) ([]*ConditionReverse, int64, error)
- func (c *ConditionReverse) Save(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) error
- type Config
- type CustomTemplate
- func (c *CustomTemplate) Delete(params *dao.Params, ids string, queryFuncs ...func(*gorm.DB) *gorm.DB) error
- func (c *CustomTemplate) GetOne(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) (*CustomTemplate, error)
- func (c *CustomTemplate) List(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) ([]*CustomTemplate, int64, error)
- func (c *CustomTemplate) Save(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) error
- type HelmChart
- func (c *HelmChart) Delete(params *dao.Params, ids string, queryFuncs ...func(*gorm.DB) *gorm.DB) error
- func (c *HelmChart) GetOne(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) (*HelmChart, error)
- func (c *HelmChart) List(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) ([]*HelmChart, int64, error)
- func (c *HelmChart) Save(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) error
- type HelmRepository
- func (c *HelmRepository) Delete(params *dao.Params, ids string, queryFuncs ...func(*gorm.DB) *gorm.DB) error
- func (c *HelmRepository) GetIDByNameAndURL(params *dao.Params) (uint, error)
- func (c *HelmRepository) GetOne(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) (*HelmRepository, error)
- func (c *HelmRepository) List(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) ([]*HelmRepository, int64, error)
- func (c *HelmRepository) Save(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) error
- func (c *HelmRepository) UpdateContent(params *dao.Params) error
- type KubeConfig
- func (c *KubeConfig) Delete(params *dao.Params, ids string, queryFuncs ...func(*gorm.DB) *gorm.DB) error
- func (c *KubeConfig) GetOne(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) (*KubeConfig, error)
- func (c *KubeConfig) List(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) ([]*KubeConfig, int64, error)
- func (c *KubeConfig) Save(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) error
- type MCPServerConfig
- func (c *MCPServerConfig) Delete(params *dao.Params, ids string, queryFuncs ...func(*gorm.DB) *gorm.DB) error
- func (c *MCPServerConfig) GetOne(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) (*MCPServerConfig, error)
- func (c *MCPServerConfig) List(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) ([]*MCPServerConfig, int64, error)
- func (c *MCPServerConfig) Save(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) error
- type MCPTool
- func (c *MCPTool) BatchSave(params *dao.Params, tools []*MCPTool, queryFuncs ...func(*gorm.DB) *gorm.DB) error
- func (c *MCPTool) Delete(params *dao.Params, ids string, queryFuncs ...func(*gorm.DB) *gorm.DB) error
- func (c *MCPTool) GetOne(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) (*MCPTool, error)
- func (c *MCPTool) List(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) ([]*MCPTool, int64, error)
- func (c *MCPTool) Save(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) error
- type MCPToolLog
- func (c *MCPToolLog) Delete(params *dao.Params, ids string, queryFuncs ...func(*gorm.DB) *gorm.DB) error
- func (c *MCPToolLog) GetOne(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) (*MCPToolLog, error)
- func (c *MCPToolLog) List(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) ([]*MCPToolLog, int64, error)
- func (c *MCPToolLog) Save(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) error
- type McpKey
- func (c *McpKey) Delete(params *dao.Params, ids string, queryFuncs ...func(*gorm.DB) *gorm.DB) error
- func (c *McpKey) GetOne(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) (*McpKey, error)
- func (c *McpKey) List(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) ([]*McpKey, int64, error)
- func (c *McpKey) Save(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) error
- type OperationLog
- func (c *OperationLog) Delete(params *dao.Params, ids string, queryFuncs ...func(*gorm.DB) *gorm.DB) error
- func (c *OperationLog) GetOne(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) (*OperationLog, error)
- func (c *OperationLog) List(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) ([]*OperationLog, int64, error)
- func (c *OperationLog) Save(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) error
- type SSOConfig
- func (s *SSOConfig) Delete(params *dao.Params, ids string, queryFuncs ...func(*gorm.DB) *gorm.DB) error
- func (s *SSOConfig) GetOne(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) (*SSOConfig, error)
- func (s *SSOConfig) List(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) ([]*SSOConfig, int64, error)
- func (s *SSOConfig) Save(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) error
- type ShellLog
- func (c *ShellLog) Delete(params *dao.Params, ids string, queryFuncs ...func(*gorm.DB) *gorm.DB) error
- func (c *ShellLog) GetOne(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) (*ShellLog, error)
- func (c *ShellLog) List(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) ([]*ShellLog, int64, error)
- func (c *ShellLog) Save(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) error
- type User
- func (c *User) Delete(params *dao.Params, ids string, queryFuncs ...func(*gorm.DB) *gorm.DB) error
- func (c *User) GetOne(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) (*User, error)
- func (c *User) List(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) ([]*User, int64, error)
- func (c *User) Save(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) error
- type UserGroup
- func (c *UserGroup) Delete(params *dao.Params, ids string, queryFuncs ...func(*gorm.DB) *gorm.DB) error
- func (c *UserGroup) GetOne(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) (*UserGroup, error)
- func (c *UserGroup) List(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) ([]*UserGroup, int64, error)
- func (c *UserGroup) Save(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddInnerMCPServer ¶ added in v0.0.66
func AddInnerMCPServer() error
func AutoMigrate ¶
func AutoMigrate() error
func FixClusterAuthorizationTypeName ¶ added in v0.0.87
func FixClusterAuthorizationTypeName() error
func FixClusterName ¶ added in v0.0.48
func FixClusterName() error
func FixRoleName ¶ added in v0.0.69
func FixRoleName() error
func InitConditionTable ¶ added in v0.0.86
func InitConditionTable() error
func InitConfigTable ¶ added in v0.0.74
func InitConfigTable() error
Types ¶
type ApiKey ¶ added in v0.0.80
type ApiKey struct {
ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty"`
Username string `gorm:"index;not null" json:"username,omitempty"` // 所属用户
Key string `gorm:"type:text" json:"key,omitempty"` // API密钥值
Description string `json:"description,omitempty"` // 描述信息
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"` // Automatically managed by GORM for update time
CreatedBy string `json:"created_by,omitempty"` // 创建者
LastUsedAt time.Time `json:"last_used_at,omitempty"` // 最后使用时间
}
ApiKey 用户API密钥
type ClusterUserRole ¶ added in v0.0.69
type ClusterUserRole struct {
ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty"`
Cluster string `gorm:"index" json:"cluster,omitempty"` // 集群名称
Username string `gorm:"index" json:"username,omitempty"` // 用户名
Role string `gorm:"index" json:"role,omitempty"` // 角色类型:只读、读写、Exec
Namespaces string `json:"namespaces,omitempty"` // Namespaces列表,逗号分割 ,该用户可以访问的Ns
AuthorizationType constants.ClusterAuthorizationType `json:"authorization_type,omitempty"` // 用户类型。User\Group两种,默认为User,空为User。Group指用户组
CreatedBy string `gorm:"index" json:"created_by,omitempty"` // 创建者
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
}
ClusterUserRole 集群用户权限表 AuthorizationType有两种类型(user、user_group),如果是用户,那么代表这个人有哪些权限 如果是Group,那么代表这个组有哪些权限,这个组可能会有多个用户,那么这多个用户都有相关的权限
func (*ClusterUserRole) GetOne ¶ added in v0.0.69
func (c *ClusterUserRole) GetOne(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) (*ClusterUserRole, error)
type ConditionReverse ¶ added in v0.0.86
type ConditionReverse struct {
ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty"`
Name string `gorm:"type:text" json:"name,omitempty"` // 指标名称,使用包含方式查找。如Pressure、Unavailable等
Enabled bool `json:"enabled,omitempty"` // 指标描述
Description string `gorm:"type:text" json:"description,omitempty"` // 指标描述
CreatedAt time.Time `json:"created_at,omitempty"` // 创建时间
UpdatedAt time.Time `json:"updated_at,omitempty"` // 更新时间
}
ConditionReverse 用于记录需要反转解释的K8s状态指标
func (*ConditionReverse) Delete ¶ added in v0.0.86
func (c *ConditionReverse) Delete(params *dao.Params, ids string, queryFuncs ...func(*gorm.DB) *gorm.DB) error
Delete 删除记录
func (*ConditionReverse) GetOne ¶ added in v0.0.86
func (c *ConditionReverse) GetOne(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) (*ConditionReverse, error)
GetOne 获取单条记录
type Config ¶ added in v0.0.74
type Config struct {
ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty"`
// Port int `json:"port,omitempty"`
// MCPServerPort int `json:"mcp_server_port,omitempty"`
// KubeConfig string `json:"kube_config,omitempty"`
ApiKey string `json:"api_key,omitempty"`
ApiURL string `json:"api_url,omitempty"`
ApiModel string `json:"api_model,omitempty"`
// Debug bool `gorm:"default:false" json:"debug"`
// LogV int `json:"log_v,omitempty"`
// InCluster bool `gorm:"default:true" json:"in_cluster"`
LoginType string `json:"login_type,omitempty"`
JwtTokenSecret string `json:"jwt_token_secret,omitempty"`
NodeShellImage string `json:"node_shell_image,omitempty"`
KubectlShellImage string `json:"kubectl_shell_image,omitempty"`
// SqlitePath string `json:"sqlite_path,omitempty"`
AnySelect bool `gorm:"default:true" json:"any_select"`
PrintConfig bool `json:"print_config"`
EnableAI bool `gorm:"default:true" json:"enable_ai"` // 是否启用AI功能,默认开启
UseBuiltInModel bool `gorm:"default:true" json:"use_built_in_model"`
// ConnectCluster bool `json:"connect_cluster"` // 启动集群是是否自动连接现有集群,默认关闭
CreatedAt time.Time `json:"created_at,omitempty"` // Automatically managed by GORM for creation time
UpdatedAt time.Time `json:"updated_at,omitempty"` // Automatically managed by GORM for update time
}
type CustomTemplate ¶
type CustomTemplate struct {
ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty"` // 模板 ID,主键,自增
Name string `gorm:"index" json:"name,omitempty"` // 模板名称,非空,最大长度 255
Content string `gorm:"type:text" json:"content,omitempty"` // 模板内容,支持大文本存储
Kind string `gorm:"index" json:"kind,omitempty"` // 模板类型,最大长度 100
Cluster string `gorm:"index" json:"cluster,omitempty"` // 模板类型,最大长度 100
IsGlobal bool `gorm:"index" json:"is_global,omitempty"` // 模板类型,最大长度 100
CreatedBy string `gorm:"index" json:"created_by,omitempty"` // 创建者
CreatedAt time.Time `json:"created_at,omitempty"` // Automatically managed by GORM for creation time
UpdatedAt time.Time `json:"updated_at,omitempty"` // Automatically managed by GORM for update time
}
CustomTemplate 表示用户自定义模板表的结构体
func (*CustomTemplate) GetOne ¶
func (c *CustomTemplate) GetOne(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) (*CustomTemplate, error)
type HelmChart ¶ added in v0.0.51
type HelmChart struct {
ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty"`
RepositoryID uint `gorm:"index;not null" json:"repository_id,omitempty"` // 关联仓库ID
RepositoryName string `json:"repository_name,omitempty"` // 关联仓库ID
Name string `gorm:"index;not null" json:"name,omitempty"` // Chart名称
LatestVersion string `json:"latest_version,omitempty"` // 最新版本(冗余字段,优化查询)
Description string `json:"description,omitempty"` // Chart描述
Home string `json:"home,omitempty"` // 项目主页URL
Icon string `json:"icon,omitempty"` // Chart图标链接
Keywords pq.StringArray `gorm:"type:text[]" json:"keywords,omitempty"` // 关键词(PostgreSQL数组类型)
KubeVersion string `json:"kubeVersion,omitempty"` // 最低k8s版本要求
AppVersion string `json:"appVersion,omitempty"` // app应用版本
Deprecated bool `json:"deprecated,omitempty"` // Whether or not this chart is deprecated
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Sources string `json:"sources,omitempty"` // 源码主页
}
type HelmRepository ¶ added in v0.0.51
type HelmRepository struct {
ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty"`
Name string `gorm:"not null" json:"name,omitempty"` // 仓库名称(唯一)
URL string `gorm:"not null" json:"url,omitempty"` // 仓库地址(如 https://charts.example.com)
Type string `gorm:"comment:仓库类型(OCI/HTTP)" json:"type,omitempty"`
Description string `json:"description,omitempty"` // 仓库描述
AuthType string `gorm:"comment:认证类型(Basic/AuthToken/OAuth)" json:"auth_type,omitempty"`
Username string `json:"username,omitempty"` // 认证用户名(加密存储)
Password string `gorm:"-;comment:密码(临时字段,存储时需加密)" json:"password,omitempty"`
EncryptedSecret string `gorm:"comment:加密后的凭据" json:"encrypted_secret,omitempty"`
IsActive bool `gorm:"default:true" json:"is_active,omitempty"` // 是否启用
Content string `gorm:"type:text" json:"content,omitempty"` // 模板内容,支持大文本存储
Generated string `json:"generated,omitempty"` // repo 索引文件创建时间
CertFile string `json:"certFile,omitempty"`
KeyFile string `json:"keyFile,omitempty"`
CAFile string `json:"caFile,omitempty"`
InsecureSkipTLSverify bool `json:"insecure_skip_tls_verify,omitempty"`
PassCredentialsAll bool `json:"pass_credentials_all,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"` // Automatically managed by GORM for creation time
UpdatedAt time.Time `json:"updated_at,omitempty"` // Automatically managed by GORM for update time
}
func (*HelmRepository) GetIDByNameAndURL ¶ added in v0.0.51
func (c *HelmRepository) GetIDByNameAndURL(params *dao.Params) (uint, error)
func (*HelmRepository) GetOne ¶ added in v0.0.51
func (c *HelmRepository) GetOne(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) (*HelmRepository, error)
func (*HelmRepository) List ¶ added in v0.0.51
func (c *HelmRepository) List(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) ([]*HelmRepository, int64, error)
func (*HelmRepository) UpdateContent ¶ added in v0.0.51
func (c *HelmRepository) UpdateContent(params *dao.Params) error
type KubeConfig ¶
type KubeConfig struct {
ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty"` // 模板 ID,主键,自增
Content string `gorm:"type:text" json:"content,omitempty"` // 模板内容,支持大文本存储
Server string `gorm:"index" json:"server,omitempty"`
User string `gorm:"index" json:"user,omitempty"`
Cluster string `gorm:"index" json:"cluster,omitempty"` // 模板类型,最大长度 100
Namespace string `gorm:"index" json:"namespace,omitempty"`
DisplayName string `gorm:"index" json:"display_name,omitempty"`
CreatedBy string `gorm:"index" json:"created_by,omitempty"` // 创建者
CreatedAt time.Time `json:"created_at,omitempty"` // Automatically managed by GORM for creation time
UpdatedAt time.Time `json:"updated_at,omitempty"` // Automatically managed by GORM for update time
}
KubeConfig 用户导入kubeconfig
func (*KubeConfig) GetOne ¶
func (c *KubeConfig) GetOne(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) (*KubeConfig, error)
type MCPServerConfig ¶ added in v0.0.64
type MCPServerConfig struct {
ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty"`
URL string `gorm:"not null" json:"url,omitempty"`
Name string `gorm:"uniqueIndex;not null" json:"name,omitempty"`
Enabled bool `gorm:"default:false" json:"enabled,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
CreatedBy string `gorm:"index" json:"created_by,omitempty"`
}
MCPServerConfig MCP服务器配置
func (*MCPServerConfig) GetOne ¶ added in v0.0.64
func (c *MCPServerConfig) GetOne(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) (*MCPServerConfig, error)
type MCPTool ¶ added in v0.0.85
type MCPTool struct {
ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty"`
ServerName string `json:"server_name,omitempty"` // mcp server id,唯一
Name string `gorm:"uniqueIndex;not null" json:"name,omitempty"` // 工具名称,唯一
Description string `gorm:"type:text" json:"description,omitempty"` // 工具描述
InputSchema string `gorm:"type:text" json:"input_schema,omitempty"` // 输入模式,JSON格式
Enabled bool `gorm:"default:true" json:"enabled,omitempty"` // 是否启用
CreatedAt time.Time `json:"created_at,omitempty"` // 创建时间
UpdatedAt time.Time `json:"updated_at,omitempty"` // 更新时间
CreatedBy string `json:"created_by,omitempty"` // 创建者
}
MCPTool MCP工具配置
type MCPToolLog ¶ added in v0.0.88
type MCPToolLog struct {
ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty"`
ToolName string `gorm:"index" json:"tool_name,omitempty"` // 工具名称
ServerName string `gorm:"index" json:"server_name,omitempty"` // 服务器名称
Parameters string `gorm:"type:text" json:"parameters,omitempty"` // 执行参数
Prompt string `gorm:"type:text" json:"prompt,omitempty"`
Result string `gorm:"type:text" json:"result,omitempty"` // 执行结果
Error string `gorm:"type:text" json:"error,omitempty"` // 错误信息
ExecuteTime int64 `json:"execute_time,omitempty"` // 执行时间(毫秒)
CreatedAt time.Time `json:"created_at,omitempty"`
CreatedBy string `gorm:"index" json:"created_by,omitempty"`
}
MCPToolLog MCP工具执行日志
func (*MCPToolLog) GetOne ¶ added in v0.0.88
func (c *MCPToolLog) GetOne(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) (*MCPToolLog, error)
type McpKey ¶ added in v0.0.89
type McpKey struct {
ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty"`
Username string `gorm:"index;not null" json:"username,omitempty"` // 所属用户
Key string `gorm:"type:text" json:"key,omitempty"` // MCP密钥值
Description string `json:"description,omitempty"` // 描述信息
Enabled bool `gorm:"default:true" json:"enabled,omitempty"` // 是否启用
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"` // Automatically managed by GORM for update time
CreatedBy string `json:"created_by,omitempty"` // 创建者
LastUsedAt time.Time `json:"last_used_at,omitempty"` // 最后使用时间
}
McpKey MCP访问密钥
type OperationLog ¶
type OperationLog struct {
ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty"` // 模板 ID,主键,自增
UserName string `json:"username,omitempty"`
Role string `json:"role,omitempty"`
Cluster string `gorm:"index" json:"cluster,omitempty"`
Namespace string `json:"namespace,omitempty"`
Name string `json:"name,omitempty"`
Group string `json:"group,omitempty"` // 资源group
Kind string `json:"kind,omitempty"` // 资源kind
Action string `json:"action,omitempty"` // 操作类型
Params string `gorm:"type:text" json:"params,omitempty"` // 操作参数
ActionResult string `json:"action_result,omitempty"` // 操作结果
CreatedAt time.Time `json:"created_at,omitempty"` // Automatically managed by GORM for creation time
UpdatedAt time.Time `json:"updated_at,omitempty"` // Automatically managed by GORM for update time
}
OperationLog 用户导入OperationLog
func (*OperationLog) GetOne ¶
func (c *OperationLog) GetOne(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) (*OperationLog, error)
type SSOConfig ¶ added in v0.0.92
type SSOConfig struct {
ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty"`
Name string `json:"name,omitempty"` // 配置名称
Type string `gorm:"default:oidc" json:"type,omitempty"` // 配置类型
ClientID string `gorm:"type:text;" json:"client_id,omitempty"` // OAuth2客户端ID
ClientSecret string `gorm:"type:text;" json:"client_secret,omitempty"` // OAuth2客户端密钥
Issuer string `gorm:"type:text;" json:"issuer,omitempty"` // 认证服务器地址
Enabled bool `gorm:"default:false" json:"enabled,omitempty"` // 是否启用SSO
PreferUserNameKeys string `gorm:"type:text;" json:"prefer_user_name_keys,omitempty"` // 用户自定义获取用户名的字段顺序,适用于如果用户名字段不在默认字段中情况
Scopes string `gorm:"type:text;" json:"scopes,omitempty"` // 授权范围
CreatedAt time.Time `json:"created_at,omitempty"` // 创建时间
UpdatedAt time.Time `json:"updated_at,omitempty"` // 更新时间
CreatedBy string `json:"created_by,omitempty"`
}
SSOConfig SSO配置表
func (*SSOConfig) Delete ¶ added in v0.0.92
func (s *SSOConfig) Delete(params *dao.Params, ids string, queryFuncs ...func(*gorm.DB) *gorm.DB) error
Delete 删除记录
func (*SSOConfig) GetOne ¶ added in v0.0.92
func (s *SSOConfig) GetOne(params *dao.Params, queryFuncs ...func(*gorm.DB) *gorm.DB) (*SSOConfig, error)
GetOne 获取单条记录
type ShellLog ¶
type ShellLog struct {
ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty"` // 模板 ID,主键,自增
UserName string `json:"username,omitempty"`
Cluster string `json:"cluster,omitempty"`
Namespace string `json:"namespace,omitempty"`
PodName string `json:"pod_name,omitempty"`
ContainerName string `json:"container_name,omitempty"`
Command string `json:"command,omitempty"` // shell 执行命令
Role string `json:"role,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"` // Automatically managed by GORM for creation time
UpdatedAt time.Time `json:"updated_at,omitempty"` // Automatically managed by GORM for update time
}
ShellLog 用户导入ShellLog
type User ¶
type User struct {
ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty"`
Username string `gorm:"uniqueIndex;not null" json:"username,omitempty"`
Salt string `gorm:"not null" json:"salt,omitempty"`
Password string `gorm:"not null" json:"password,omitempty"`
GroupNames string `json:"group_names,omitempty"`
Source string `json:"source,omitempty"` // 来源,如:db, ldap, oauth
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"` // Automatically managed by GORM for update time
CreatedBy string `gorm:"index:idx_created_by" json:"created_by,omitempty"` // 创建者
// 2FA相关字段
TwoFAEnabled bool `gorm:"default:false" json:"two_fa_enabled,omitempty"` // 是否启用2FA
TwoFAType string `gorm:"size:20" json:"two_fa_type,omitempty"` // 2FA类型:如 'totp', 'sms', 'email'
TwoFASecret string `gorm:"size:100" json:"two_fa_secret,omitempty"` // 2FA密钥
TwoFABackupCodes string `gorm:"size:500" json:"two_fa_backup_codes,omitempty"` // 备用恢复码,逗号分隔
TwoFAAppName string `gorm:"size:100" json:"two_fa_app_name,omitempty"` // 2FA应用名称,用于提醒用户使用的是哪个软件
}
User 用户导入User
type UserGroup ¶ added in v0.0.55
type UserGroup struct {
ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty"`
GroupName string `gorm:"index" json:"group_name,omitempty"`
Description string `json:"description,omitempty"`
Role string `gorm:"index" json:"role,omitempty"` // 管理员/只读
CreatedBy string `gorm:"index" json:"created_by,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.