Documentation
¶
Overview ¶
Package model 应用偏好数据模型
Index ¶
- Constants
- Variables
- func ExtractFolder(objs []Obj, extractFolder string)
- func GetThumb(obj Obj) (thumb string, ok bool)
- func GetUrl(obj Obj) (url string, ok bool)
- func SortFiles(objs []Obj, orderBy, orderDirection string)
- func WrapObjsName(objs []Obj)
- type APPModel
- type AddDesktopIconRequest
- type AliyunConfig
- type App
- type AppCategory
- type AppContainerStatus
- type AppFormField
- type AppIndex
- type AppInstallRequest
- type AppPort
- type AppRequirements
- type AppResponse
- type AppSource
- type AppStatus
- type AppStoreSource
- type AppVolume
- type AppsListResponse
- type AuditAction
- type AuditLog
- type AuditLogQuery
- type AuditLogResponse
- type AuditStats
- type AuditStatus
- type BarkConfig
- type BaseInfo
- type CloudflareConfig
- type CommonModel
- type ConfigField
- type Connections
- type CreateChannelRequest
- type CreateDDNSConfigRequest
- type CreateIPRuleRequest
- type CreateRuleRequest
- type CreateShareRequest
- type CustomDDNSConfig
- type DDNSConfig
- type DDNSLog
- type DDNSProvider
- type DDNSStatsResponse
- type DDNSStatus
- type DNSPodConfig
- type DeletePermanentlyRequest
- type DesktopIcon
- type DesktopIconItem
- type DirectoryContent
- type Drive
- type DuckDNSConfig
- type DynDNSConfig
- type EmailConfig
- type ExifData
- type FileItem
- type FileOperate
- type FilePreviewInfo
- type FileSetting
- type FileShare
- type FileStream
- type FileStreamer
- type FileUpdate
- type FsOtherArgs
- type GalleryItem
- type GalleryResponse
- type GoDaddyConfig
- type GoDaddyModel
- type I18nContent
- type IOCountersStat
- type IPAccessRule
- type IPFailedCount
- type InstallTask
- type InstallTaskLog
- type InstallTaskResponse
- type InstallTasksResponse
- type InstalledApp
- type JSONMap
- type Link
- type LinkArgs
- type ListArgs
- type LoginAttempt
- type ModuleSetting
- type ModuleSettingWithMeta
- type MoveToTrashRequest
- type NoIPConfig
- type NotificationChannel
- type NotificationChannelType
- type NotificationEvent
- type NotificationEventType
- type NotificationHistory
- type NotificationRule
- type NotificationTemplate
- type Obj
- type ObjMerge
- type ObjThumb
- type ObjThumbURL
- type ObjWrapName
- type Object
- type ObjectURL
- type OtherArgs
- type PageReq
- type PageResp
- type PasswordValidation
- type PinAppRequest
- type PortAllocation
- type PreviewRequest
- type ProxyAuth
- type ProxyMode
- type ProxyTestRequest
- type ProxyTestResponse
- type PushoverConfig
- type RedisModel
- type RemoteAccessSettings
- type ResourceUsage
- type Result
- type SearchEngine
- type SecurityConfig
- type SecurityEvent
- type SecurityStatsResponse
- type SendNotificationRequest
- type ServerModel
- type SetPath
- type SettingItem
- type ShareInfo
- type ShareListItem
- type ShareResponse
- type Shares
- type SysInfoModel
- type SystemApp
- type SystemAppLaunchType
- type SystemAppSource
- type SystemAppState
- type SystemConfig
- type SystemProxyConfig
- type TaskPhase
- type TaskStatus
- type TaskbarAppItem
- type TelegramConfig
- type TestChannelRequest
- type Thumb
- type Thumbnail
- type ThumbnailCache
- type ThumbnailSize
- type TrashConfig
- type TrashItem
- type TrashListItem
- type TrashRestoreRequest
- type TrashStats
- type URL
- type UnwrapObj
- type UpdateChannelRequest
- type UpdateDDNSConfigRequest
- type UpdateDesktopIconsRequest
- type UpdatePreferencesRequest
- type UpdateRemoteAccessRequest
- type UpdateRuleRequest
- type UpdateSecurityConfigRequest
- type UpdateTaskbarRequest
- type Url
- type UserActionStat
- type UserPreference
- type UserPreferencesResponse
- type VerifyPasswordRequest
- type Version
- type VideoMetadata
- type WeChatConfig
- type WebhookConfig
Constants ¶
const ( PrefKeyStartMenuPosition = "start_menu_position" // "left" | "center" PrefKeyPinnedApps = "pinned_apps" // JSON array of app IDs PrefKeyTaskbarApps = "taskbar_apps" // JSON array of {id, order} PrefKeyRecentApps = "recent_apps" // JSON array of app IDs (最近使用) )
预定义的偏好 Key 常量
const ( SecurityEventLoginFailed = "login_failed" SecurityEventAccountLocked = "account_locked" SecurityEventAccountUnlocked = "account_unlocked" SecurityEventSuspiciousLogin = "suspicious_login" SecurityEventPasswordChanged = "password_changed" SecurityEventPasswordExpired = "password_expired" SecurityEvent2FAEnabled = "2fa_enabled" SecurityEvent2FADisabled = "2fa_disabled" SecurityEventSessionRevoked = "session_revoked" SecurityEventIPBlocked = "ip_blocked" SecurityEventBruteForceAttempt = "brute_force_attempt" )
SecurityEventType 安全事件类型
const ( SeverityInfo = "info" SeverityWarning = "warning" SeverityCritical = "critical" )
SecurityEventSeverity 安全事件严重程度
const ( SINGLE = iota SITE STYLE PREVIEW GLOBAL ARIA2 INDEX GITHUB )
const ( PUBLIC = iota PRIVATE READONLY DEPRECATED )
const MaxInt = int(MaxUint >> 1)
const MaxUint = ^uint(0)
const MinInt = -MaxInt - 1
const MinUint = 0
Variables ¶
var DefaultTrashConfig = TrashConfig{ RetentionDays: 30, MaxSize: 0, Enabled: true, }
DefaultTrashConfig 默认回收站配置
var SupportedAudioFormats = map[string]bool{ ".mp3": true, ".wav": true, ".flac": true, ".aac": true, ".ogg": true, ".wma": true, ".m4a": true, }
SupportedAudioFormats 支持的音频格式
var SupportedCodeFormats = map[string]bool{ ".go": true, ".js": true, ".ts": true, ".jsx": true, ".tsx": true, ".vue": true, ".py": true, ".java": true, ".c": true, ".cpp": true, ".h": true, ".hpp": true, ".cs": true, ".rs": true, ".rb": true, ".php": true, ".swift": true, ".kt": true, ".scala": true, ".sh": true, ".bash": true, ".zsh": true, ".fish": true, ".ps1": true, ".sql": true, ".html": true, ".css": true, ".scss": true, ".sass": true, ".less": true, ".json": true, ".xml": true, ".yaml": true, ".yml": true, ".toml": true, ".ini": true, ".conf": true, ".md": true, ".markdown": true, }
SupportedCodeFormats 支持的代码格式
var SupportedDocumentFormats = map[string]bool{ ".pdf": true, ".doc": true, ".docx": true, ".xls": true, ".xlsx": true, ".ppt": true, ".pptx": true, ".odt": true, ".ods": true, ".odp": true, }
SupportedDocumentFormats 支持的文档格式
var SupportedImageFormats = map[string]bool{ ".jpg": true, ".jpeg": true, ".png": true, ".gif": true, ".webp": true, ".svg": true, ".bmp": true, ".ico": true, ".tiff": true, ".heic": true, ".heif": true, }
SupportedImageFormats 支持的图片格式
var SupportedTextFormats = map[string]bool{ ".txt": true, ".log": true, ".csv": true, ".env": true, ".gitignore": true, ".dockerignore": true, }
SupportedTextFormats 支持的纯文本格式
var SupportedVideoFormats = map[string]bool{ ".mp4": true, ".mkv": true, ".avi": true, ".mov": true, ".wmv": true, ".flv": true, ".webm": true, ".m4v": true, ".3gp": true, }
SupportedVideoFormats 支持的视频格式
Functions ¶
func ExtractFolder ¶
func WrapObjsName ¶
func WrapObjsName(objs []Obj)
Types ¶
type APPModel ¶
type APPModel struct {
LogPath string
LogSaveName string
LogFileExt string
DateStrFormat string
DateTimeFormat string
UserDataPath string
TimeFormat string
DateFormat string
DBPath string
ShellPath string
}
服务配置
type AddDesktopIconRequest ¶
type AddDesktopIconRequest struct {
AppID string `json:"appId" binding:"required"`
X int `json:"x"`
Y int `json:"y"`
}
AddDesktopIconRequest 添加桌面图标请求
type AliyunConfig ¶
type AliyunConfig struct {
AccessKeyID string `json:"access_key_id"`
AccessKeySecret string `json:"access_key_secret"`
RegionID string `json:"region_id"`
}
AliyunConfig 阿里云 DNS 配置
type App ¶
type App struct {
// 核心标识
ID string `json:"id" yaml:"id"` // 应用唯一标识
Name string `json:"name" yaml:"name"` // 应用名称
Version string `json:"version" yaml:"version"` // 应用版本
Icon string `json:"icon" yaml:"icon"` // 图标URL
// 来源追踪(转换工具生成)
Source *AppSource `json:"source,omitempty" yaml:"source,omitempty"`
// 分类与标签
Category string `json:"category" yaml:"category"` // 分类
Tags []string `json:"tags" yaml:"tags"` // 标签
// 多语言支持
I18n map[string]*I18nContent `json:"i18n,omitempty" yaml:"i18n,omitempty"`
// 简短描述
Description string `json:"description" yaml:"description"`
// 元数据
Developer string `json:"developer" yaml:"developer"` // 开发者
Website string `json:"website,omitempty" yaml:"website,omitempty"` // 官方网站
Repository string `json:"repository" yaml:"repository"` // 源码仓库
Document string `json:"document,omitempty" yaml:"document,omitempty"` // 文档链接
License string `json:"license,omitempty" yaml:"license,omitempty"` // 开源协议
// 硬件要求
Requirements *AppRequirements `json:"requirements,omitempty" yaml:"requirements,omitempty"`
// 截图
Screenshots []string `json:"screenshots" yaml:"screenshots"`
// Docker Compose 配置 (动态解析)
Compose map[string]interface{} `json:"compose" yaml:"compose"`
// 配置表单
Form []AppFormField `json:"form" yaml:"form"`
// 端口映射定义
Ports []AppPort `json:"ports" yaml:"ports"`
// 数据卷定义
Volumes []AppVolume `json:"volumes" yaml:"volumes"`
// 环境变量
Environment map[string]string `json:"environment" yaml:"environment"`
// 依赖的其他应用
Depends []string `json:"depends" yaml:"depends"`
// Web UI 地址模板
WebUI string `json:"web_ui" yaml:"web_ui"`
}
App 应用商店中的应用定义
type AppCategory ¶
type AppCategory struct {
ID string `json:"id" yaml:"id"`
Name string `json:"name" yaml:"name"`
Icon string `json:"icon" yaml:"icon"`
Count int `json:"count" yaml:"-"`
}
AppCategory 应用分类
type AppContainerStatus ¶
type AppContainerStatus struct {
ContainerID string `json:"container_id"`
Name string `json:"name"`
Status string `json:"status"`
State string `json:"state"`
Health string `json:"health"`
CPUPercent string `json:"cpu_percent"`
MemUsage string `json:"mem_usage"`
NetIO string `json:"net_io"`
BlockIO string `json:"block_io"`
}
AppContainerStatus 容器状态
type AppFormField ¶
type AppFormField struct {
// 字段标识
Key string `json:"key" yaml:"key"`
// 显示标签(多语言)
Label map[string]string `json:"label,omitempty" yaml:"label,omitempty"`
// 字段描述
Description string `json:"description" yaml:"description"`
// 类型: text, number, password, select, boolean, path
Type string `json:"type" yaml:"type"`
// 默认值
Default interface{} `json:"default" yaml:"default"`
// 是否必填
Required bool `json:"required" yaml:"required"`
// select类型的选项
Options []string `json:"options" yaml:"options"`
// number类型的最小值
Min int `json:"min" yaml:"min"`
// number类型的最大值
Max int `json:"max" yaml:"max"`
// 占位符
Placeholder string `json:"placeholder" yaml:"placeholder"`
}
AppFormField 配置表单字段
type AppIndex ¶
type AppIndex struct {
Version string `json:"version" yaml:"version"`
UpdatedAt string `json:"updated_at" yaml:"updated_at"`
Categories []AppCategory `json:"categories" yaml:"categories"`
Apps []App `json:"apps" yaml:"apps"`
}
AppIndex 应用源索引
type AppInstallRequest ¶
type AppInstallRequest struct {
AppID string `json:"app_id" validate:"required"`
Config map[string]string `json:"config"` // 用户配置
Ports map[string]int `json:"ports"` // 自定义端口映射
}
AppInstallRequest 安装应用请求
type AppPort ¶
type AppPort struct {
Container int `json:"container" yaml:"container"` // 容器端口
Host int `json:"host" yaml:"host"` // 主机端口 (默认值)
Protocol string `json:"protocol" yaml:"protocol"` // tcp/udp
Label string `json:"label" yaml:"label"` // 端口用途说明
}
AppPort 端口定义
type AppRequirements ¶
type AppRequirements struct {
MinMemory int `json:"min_memory,omitempty" yaml:"min_memory,omitempty"` // 最小内存 (MB)
MinStorage int `json:"min_storage,omitempty" yaml:"min_storage,omitempty"` // 最小存储 (MB)
Architectures []string `json:"architectures,omitempty" yaml:"architectures,omitempty"` // amd64, arm64, arm/v7
GPUSupport bool `json:"gpu_support,omitempty" yaml:"gpu_support,omitempty"` // 是否支持 GPU
}
AppRequirements 硬件要求
type AppResponse ¶
type AppResponse struct {
ID string `json:"id"`
Name string `json:"name"`
Icon string `json:"icon"`
Source string `json:"source"`
ModuleDependency string `json:"moduleDependency,omitempty"`
LaunchConfig struct {
Type string `json:"type"`
Target string `json:"target"`
} `json:"launchConfig"`
State string `json:"state"`
Category string `json:"category,omitempty"`
Keywords string `json:"keywords,omitempty"`
}
AppResponse 单个应用响应
type AppSource ¶
type AppSource struct {
Provider string `json:"provider" yaml:"provider"` // 1panel, casaos, portainer, rde
OriginalID string `json:"original_id" yaml:"original_id"` // 原始应用 ID
SyncDate string `json:"sync_date" yaml:"sync_date"` // 同步日期
}
AppSource 应用来源追踪(转换工具生成)
type AppStatus ¶
type AppStatus struct {
InstalledApp
Containers []AppContainerStatus `json:"containers"` // 容器状态列表
}
AppStatus 应用详细状态
type AppStoreSource ¶
type AppStoreSource struct {
Name string `json:"name" yaml:"name"` // 源名称
URL string `json:"url" yaml:"url"` // 源地址 (GitHub raw URL)
}
AppStoreSource 应用源配置
type AppVolume ¶
type AppVolume struct {
Container string `json:"container" yaml:"container"` // 容器路径
Host string `json:"host" yaml:"host"` // 主机路径模板
Label string `json:"label" yaml:"label"` // 用途说明
ReadOnly bool `json:"read_only" yaml:"read_only"` // 是否只读
}
AppVolume 数据卷定义
type AppsListResponse ¶
type AppsListResponse struct {
Apps []AppResponse `json:"apps"`
}
AppsListResponse 应用列表响应
type AuditAction ¶
type AuditAction string
AuditAction 审计动作
const ( // 用户相关 AuditLogin AuditAction = "login" AuditLogout AuditAction = "logout" AuditLoginFailed AuditAction = "login_failed" AuditPasswordChange AuditAction = "password_change" AuditEnable2FA AuditAction = "enable_2fa" AuditDisable2FA AuditAction = "disable_2fa" // 用户管理 AuditUserCreate AuditAction = "user_create" AuditUserUpdate AuditAction = "user_update" AuditUserDelete AuditAction = "user_delete" AuditUserDisable AuditAction = "user_disable" AuditUserEnable AuditAction = "user_enable" // 文件操作 AuditFileCreate AuditAction = "file_create" AuditFileRead AuditAction = "file_read" AuditFileUpdate AuditAction = "file_update" AuditFileDelete AuditAction = "file_delete" AuditFileMove AuditAction = "file_move" AuditFileCopy AuditAction = "file_copy" AuditFileDownload AuditAction = "file_download" AuditFileUpload AuditAction = "file_upload" // 分享 // 权限 AuditPermissionGrant AuditAction = "permission_grant" AuditPermissionRevoke AuditAction = "permission_revoke" // 系统 AuditSystemConfig AuditAction = "system_config" AuditSettingChange AuditAction = "setting_change" // 安全服务 AuditSSHEnable AuditAction = "ssh_enable" AuditSSHDisable AuditAction = "ssh_disable" AuditTerminalEnable AuditAction = "terminal_enable" AuditTerminalDisable AuditAction = "terminal_disable" )
type AuditLog ¶
type AuditLog struct {
ID string `json:"id" gorm:"primaryKey;size:36"`
UserID string `json:"user_id" gorm:"index;size:36"`
Username string `json:"username" gorm:"size:50"`
Action AuditAction `json:"action" gorm:"index;size:30;not null"`
Resource string `json:"resource" gorm:"size:1000"` // 操作的资源路径/名称
Details string `json:"details" gorm:"type:text"` // JSON 详细信息
IP string `json:"ip" gorm:"size:50"`
UserAgent string `json:"user_agent" gorm:"size:500"`
Status AuditStatus `json:"status" gorm:"size:20;default:success"`
ErrorMsg string `json:"error_msg" gorm:"size:500"`
Duration int64 `json:"duration"` // 操作耗时(毫秒)
CreatedAt time.Time `json:"created_at" gorm:"index"`
}
AuditLog 审计日志
type AuditLogQuery ¶
type AuditLogQuery struct {
UserID string `json:"user_id"`
Username string `json:"username"`
Action AuditAction `json:"action"`
Resource string `json:"resource"`
Status AuditStatus `json:"status"`
IP string `json:"ip"`
StartTime *time.Time `json:"start_time"`
EndTime *time.Time `json:"end_time"`
Page int `json:"page"`
PageSize int `json:"page_size"`
}
AuditLogQuery 审计日志查询条件
type AuditLogResponse ¶
type AuditLogResponse struct {
Logs []*AuditLog `json:"logs"`
Total int64 `json:"total"`
Page int `json:"page"`
Size int `json:"size"`
}
AuditLogResponse 审计日志响应
type AuditStats ¶
type AuditStats struct {
TotalLogs int64 `json:"total_logs"`
SuccessCount int64 `json:"success_count"`
FailedCount int64 `json:"failed_count"`
ActionCounts map[string]int64 `json:"action_counts"`
TopUsers []UserActionStat `json:"top_users"`
RecentActivity []*AuditLog `json:"recent_activity"`
}
AuditStats 审计统计
type AuditStatus ¶
type AuditStatus string
AuditStatus 审计状态
const ( AuditStatusSuccess AuditStatus = "success" AuditStatusFailed AuditStatus = "failed" )
type BarkConfig ¶
type BarkConfig struct {
ServerURL string `json:"server_url"`
DeviceKey string `json:"device_key"`
}
BarkConfig Bark 配置 (iOS 推送)
type CloudflareConfig ¶
type CloudflareConfig struct {
APIToken string `json:"api_token"` // API Token 或 Global API Key
ZoneID string `json:"zone_id"` // Zone ID
Email string `json:"email"` // 可选,使用 Global API Key 时需要
Proxied bool `json:"proxied"` // 是否启用 Cloudflare 代理
}
CloudflareConfig Cloudflare 配置
type CommonModel ¶
type CommonModel struct {
RuntimePath string
}
type ConfigField ¶
type ConfigField struct {
Key string `json:"key"`
Label string `json:"label"`
Type string `json:"type"` // string/number/bool/select
Default interface{} `json:"default"`
Options []string `json:"options,omitempty"` // select 选项
Description string `json:"description,omitempty"`
Required bool `json:"required,omitempty"`
}
ConfigField 配置字段定义(用于前端渲染表单)
type Connections ¶
type CreateChannelRequest ¶
type CreateChannelRequest struct {
Name string `json:"name" validate:"required"`
Type NotificationChannelType `json:"type" validate:"required"`
Config interface{} `json:"config" validate:"required"`
Description string `json:"description"`
}
CreateChannelRequest 创建通知渠道请求
type CreateDDNSConfigRequest ¶
type CreateDDNSConfigRequest struct {
Name string `json:"name" validate:"required"`
Provider DDNSProvider `json:"provider" validate:"required"`
Domain string `json:"domain" validate:"required"`
Subdomain string `json:"subdomain"`
Config interface{} `json:"config" validate:"required"`
UpdateInterval int `json:"update_interval"`
Enabled bool `json:"enabled"`
}
CreateDDNSConfigRequest 创建 DDNS 配置请求
type CreateIPRuleRequest ¶
type CreateIPRuleRequest struct {
Type string `json:"type" validate:"required,oneof=whitelist blacklist"`
IP string `json:"ip" validate:"required"`
Description string `json:"description"`
}
CreateIPRuleRequest 创建 IP 规则请求
type CreateRuleRequest ¶
type CreateRuleRequest struct {
Name string `json:"name" validate:"required"`
EventType NotificationEventType `json:"event_type" validate:"required"`
ChannelID string `json:"channel_id" validate:"required"`
Conditions map[string]interface{} `json:"conditions"`
Template string `json:"template"`
Cooldown int `json:"cooldown"`
}
CreateRuleRequest 创建通知规则请求
type CustomDDNSConfig ¶
type CustomDDNSConfig struct {
UpdateURL string `json:"update_url"` // 更新 URL,支持变量替换
Method string `json:"method"` // HTTP 方法
Headers map[string]string `json:"headers"` // 自定义请求头
Body string `json:"body"` // 请求体模板
}
CustomDDNSConfig 自定义 DDNS 配置
type DDNSConfig ¶
type DDNSConfig struct {
ID string `json:"id" gorm:"primaryKey;size:36"`
Name string `json:"name" gorm:"size:100;not null"`
Provider DDNSProvider `json:"provider" gorm:"size:30;not null"`
Enabled bool `json:"enabled" gorm:"default:false"`
Domain string `json:"domain" gorm:"size:200;not null"` // 完整域名
Subdomain string `json:"subdomain" gorm:"size:100"` // 子域名
Config string `json:"config" gorm:"type:text"` // JSON 配置(API密钥等)
UpdateInterval int `json:"update_interval" gorm:"default:300"` // 更新间隔(秒)
CurrentIP string `json:"current_ip" gorm:"size:50"`
LastIP string `json:"last_ip" gorm:"size:50"`
Status DDNSStatus `json:"status" gorm:"size:20;default:inactive"`
LastUpdateAt *time.Time `json:"last_update_at"`
LastCheckAt *time.Time `json:"last_check_at"`
LastError string `json:"last_error" gorm:"size:500"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
DDNSConfig DDNS 配置
type DDNSLog ¶
type DDNSLog struct {
ID string `json:"id" gorm:"primaryKey;size:36"`
ConfigID string `json:"config_id" gorm:"size:36;index"`
OldIP string `json:"old_ip" gorm:"size:50"`
NewIP string `json:"new_ip" gorm:"size:50"`
Success bool `json:"success" gorm:"default:false"`
Message string `json:"message" gorm:"size:500"`
CreatedAt time.Time `json:"created_at" gorm:"index"`
}
DDNSLog DDNS 更新日志
type DDNSProvider ¶
type DDNSProvider string
DDNSProvider DDNS 提供商类型
const ( DDNSProviderCloudflare DDNSProvider = "cloudflare" DDNSProviderGoDaddy DDNSProvider = "godaddy" DDNSProviderAliyun DDNSProvider = "aliyun" DDNSProviderDNSPod DDNSProvider = "dnspod" DDNSProviderDynDNS DDNSProvider = "dyndns" DDNSProviderNoIP DDNSProvider = "noip" DDNSProviderDuckDNS DDNSProvider = "duckdns" DDNSProviderCustom DDNSProvider = "custom" )
type DDNSStatsResponse ¶
type DDNSStatsResponse struct {
TotalConfigs int64 `json:"total_configs"`
ActiveConfigs int64 `json:"active_configs"`
ErrorConfigs int64 `json:"error_configs"`
CurrentIP string `json:"current_ip"`
LastUpdateTime string `json:"last_update_time"`
}
DDNSStatsResponse DDNS 统计响应
type DDNSStatus ¶
type DDNSStatus string
DDNSStatus DDNS 状态
const ( DDNSStatusActive DDNSStatus = "active" DDNSStatusInactive DDNSStatus = "inactive" DDNSStatusError DDNSStatus = "error" )
type DNSPodConfig ¶
type DNSPodConfig struct {
SecretID string `json:"secret_id"`
SecretKey string `json:"secret_key"`
}
DNSPodConfig DNSPod 配置
type DeletePermanentlyRequest ¶
type DeletePermanentlyRequest struct {
IDs []string `json:"ids" binding:"required"` // 要永久删除的项目 ID 列表
}
DeletePermanentlyRequest 永久删除请求
type DesktopIcon ¶
type DesktopIcon struct {
ID uint `json:"id" gorm:"primaryKey;autoIncrement"`
UserID string `json:"user_id" gorm:"size:36;not null;index:idx_desktop_user_app,unique"`
AppID string `json:"app_id" gorm:"size:64;not null;index:idx_desktop_user_app,unique"`
PositionX int `json:"position_x" gorm:"not null;default:0"`
PositionY int `json:"position_y" gorm:"not null;default:0"`
CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime"`
UpdatedAt time.Time `json:"updated_at" gorm:"autoUpdateTime"`
DeletedAt gorm.DeletedAt `json:"-" gorm:"index"`
}
DesktopIcon 桌面图标配置
type DesktopIconItem ¶
DesktopIconItem 桌面图标项
type DirectoryContent ¶
type DirectoryContent struct {
Name string `json:"name"`
IsDir bool `json:"is_dir"`
Size int64 `json:"size"`
ModifiedAt time.Time `json:"modified_at"`
}
DirectoryContent 目录内容(用于分享目录时列出内容)
type DuckDNSConfig ¶
type DuckDNSConfig struct {
Token string `json:"token"`
}
DuckDNSConfig DuckDNS 配置
type DynDNSConfig ¶
DynDNSConfig DynDNS 配置
type EmailConfig ¶
type EmailConfig struct {
SMTPHost string `json:"smtp_host"`
SMTPPort int `json:"smtp_port"`
SMTPUsername string `json:"smtp_username"`
SMTPPassword string `json:"smtp_password"`
UseTLS bool `json:"use_tls"`
FromAddress string `json:"from_address"`
FromName string `json:"from_name"`
}
EmailConfig 邮件配置
type ExifData ¶
type ExifData struct {
Make string `json:"make,omitempty"` // 相机品牌
Model string `json:"model,omitempty"` // 相机型号
DateTime *time.Time `json:"date_time,omitempty"` // 拍摄时间
Width int `json:"width,omitempty"` // 原始宽度
Height int `json:"height,omitempty"` // 原始高度
Orientation int `json:"orientation,omitempty"` // 方向
FNumber float64 `json:"f_number,omitempty"` // 光圈值
ExposureTime string `json:"exposure_time,omitempty"` // 曝光时间
ISOSpeed int `json:"iso_speed,omitempty"` // ISO
FocalLength float64 `json:"focal_length,omitempty"` // 焦距
GPSLatitude float64 `json:"gps_latitude,omitempty"` // GPS 纬度
GPSLongitude float64 `json:"gps_longitude,omitempty"` // GPS 经度
Software string `json:"software,omitempty"` // 软件
}
ExifData EXIF 元数据
type FileOperate ¶
type FileOperate struct {
Type string `json:"type" binding:"required"`
Item []FileItem `json:"item" binding:"required"`
TotalSize int64 `json:"total_size"`
ProcessedSize int64 `json:"processed_size"`
To string `json:"to" binding:"required"`
Style string `json:"style"`
Finished bool `json:"finished"`
}
type FilePreviewInfo ¶
type FilePreviewInfo struct {
Type string `json:"type"` // image, video, audio, document, code, text, unknown
MimeType string `json:"mime_type"` // MIME 类型
ThumbnailURL string `json:"thumbnail_url,omitempty"` // 缩略图 URL
PreviewURL string `json:"preview_url,omitempty"` // 预览 URL
DownloadURL string `json:"download_url,omitempty"` // 下载 URL
Exif *ExifData `json:"exif,omitempty"` // EXIF 数据(图片)
VideoMeta *VideoMetadata `json:"video_meta,omitempty"` // 视频元数据
CanPreview bool `json:"can_preview"` // 是否支持预览
CanEdit bool `json:"can_edit"` // 是否支持编辑
}
FilePreviewInfo 文件预览信息
type FileSetting ¶
type FileSetting struct {
DownloadDir string `json:"download_dir"`
}
type FileStream ¶
func (*FileStream) GetMimetype ¶
func (f *FileStream) GetMimetype() string
func (*FileStream) GetOld ¶
func (f *FileStream) GetOld() Obj
func (*FileStream) GetReadCloser ¶
func (f *FileStream) GetReadCloser() io.ReadCloser
func (*FileStream) NeedStore ¶
func (f *FileStream) NeedStore() bool
func (*FileStream) SetReadCloser ¶
func (f *FileStream) SetReadCloser(rc io.ReadCloser)
type FileStreamer ¶
type FileStreamer interface {
io.ReadCloser
Obj
GetMimetype() string
SetReadCloser(io.ReadCloser)
NeedStore() bool
GetReadCloser() io.ReadCloser
GetOld() Obj
}
type FileUpdate ¶
type FsOtherArgs ¶
type GalleryItem ¶
type GalleryItem struct {
Path string `json:"path"`
Name string `json:"name"`
ThumbnailURL string `json:"thumbnail_url"`
PreviewURL string `json:"preview_url"`
Width int `json:"width"`
Height int `json:"height"`
Size int64 `json:"size"`
ModTime time.Time `json:"mod_time"`
Exif *ExifData `json:"exif,omitempty"`
}
GalleryItem 画廊项目
type GalleryResponse ¶
type GalleryResponse struct {
Items []GalleryItem `json:"items"`
Total int `json:"total"`
HasMore bool `json:"has_more"`
NextCursor string `json:"next_cursor,omitempty"`
}
GalleryResponse 画廊响应
type GoDaddyConfig ¶
GoDaddyConfig GoDaddy 配置
type GoDaddyModel ¶
type GoDaddyModel struct {
Type uint `json:"type"`
ApiHost string `json:"api_host"`
Key string `json:"key"`
Secret string `json:"secret"`
Host string `json:"host"`
}
GoDaddyModel 旧版 GoDaddy 模型(保留兼容)
type I18nContent ¶
type I18nContent struct {
Description string `json:"description,omitempty" yaml:"description,omitempty"` // 详细描述
Tagline string `json:"tagline,omitempty" yaml:"tagline,omitempty"` // 简短标语
}
I18nContent 多语言内容
type IOCountersStat ¶
type IOCountersStat struct {
Name string `json:"name"` // interface name
BytesSent uint64 `json:"bytesSent"` // number of bytes sent
BytesRecv uint64 `json:"bytesRecv"` // number of bytes received
PacketsSent uint64 `json:"packetsSent"` // number of packets sent
PacketsRecv uint64 `json:"packetsRecv"` // number of packets received
Errin uint64 `json:"errin"` // total number of errors while receiving
Errout uint64 `json:"errout"` // total number of errors while sending
Dropin uint64 `json:"dropin"` // total number of incoming packets which were dropped
Dropout uint64 `json:"dropout"` // total number of outgoing packets which were dropped (always 0 on OSX and BSD)
Fifoin uint64 `json:"fifoin"` // total number of FIFO buffers errors while receiving
Fifoout uint64 `json:"fifoout"` // total number of FIFO buffers errors while sending
State string `json:"state"`
Time int64 `json:"time"`
}
type IPAccessRule ¶
type IPAccessRule struct {
ID string `json:"id" gorm:"primaryKey;size:36"`
Type string `json:"type" gorm:"size:10;not null"` // whitelist, blacklist
IP string `json:"ip" gorm:"size:50;not null"` // IP 地址或 CIDR
Description string `json:"description" gorm:"size:200"`
CreatedBy string `json:"created_by" gorm:"size:36"`
CreatedAt time.Time `json:"created_at"`
}
IPAccessRule IP 访问规则
type IPFailedCount ¶
IPFailedCount IP 失败次数统计
type InstallTask ¶
type InstallTask struct {
ID string `json:"id" gorm:"primaryKey"` // 任务ID (UUID)
AppID string `json:"app_id" gorm:"index;not null"` // 应用ID
AppName string `json:"app_name"` // 应用名称
AppIcon string `json:"app_icon"` // 应用图标
Status TaskStatus `json:"status" gorm:"default:'pending'"` // 任务状态
Phase TaskPhase `json:"phase" gorm:"default:'init'"` // 当前阶段
Progress int `json:"progress" gorm:"default:0"` // 进度百分比 0-100
Message string `json:"message"` // 当前操作消息
ErrorMessage string `json:"error_message"` // 错误信息
Logs string `json:"logs" gorm:"type:text"` // 安装日志 (JSON数组)
Config string `json:"config" gorm:"type:text"` // 安装配置 (JSON)
InstalledAppID uint `json:"installed_app_id"` // 安装完成后的应用ID
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
InstallTask 安装任务
type InstallTaskLog ¶
type InstallTaskLog struct {
Time time.Time `json:"time"`
Phase TaskPhase `json:"phase"`
Message string `json:"message"`
}
InstallTaskLog 安装日志条目
type InstallTaskResponse ¶
type InstallTaskResponse struct {
TaskID string `json:"task_id"`
}
InstallTaskResponse 安装任务响应
type InstallTasksResponse ¶
type InstallTasksResponse struct {
Tasks []InstallTask `json:"tasks"`
}
InstallTasksResponse 任务列表响应
type InstalledApp ¶
type InstalledApp struct {
ID uint `json:"id" gorm:"primaryKey"`
AppID string `json:"app_id" gorm:"index;not null"` // 应用ID
Name string `json:"name" gorm:"not null"` // 应用名称
Version string `json:"version"` // 安装版本
Icon string `json:"icon"` // 图标
Status string `json:"status" gorm:"default:'stopped'"` // 状态: installing, running, stopped, error
ContainerIDs string `json:"container_ids"` // 容器ID列表 (JSON)
NetworkID string `json:"network_id"` // Docker网络ID
Config string `json:"config"` // 用户配置 (JSON)
Ports string `json:"ports"` // 端口映射 (JSON)
DataPath string `json:"data_path"` // 数据存储路径
WebUI string `json:"web_ui"` // Web UI 地址
ErrorMessage string `json:"error_message"` // 错误信息
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
ContainerList []string `json:"container_list" gorm:"-"` // 容器ID列表 (运行时)
PortsMap map[string]string `json:"ports_map" gorm:"-"` // 端口映射 (运行时)
ConfigMap map[string]string `json:"config_map" gorm:"-"` // 配置映射 (运行时)
ResourceUsage *ResourceUsage `json:"resource_usage,omitempty" gorm:"-"` // 资源使用情况 (运行时)
}
InstalledApp 已安装的应用
type Link ¶
type Link struct {
URL string `json:"url"`
Header http.Header `json:"header"` // needed header
Data io.ReadCloser // return file reader directly
Status int // status maybe 200 or 206, etc
FilePath *string // local file, return the filepath
Expiration *time.Duration // url expiration time
Method string `json:"method"` // http method
}
type LoginAttempt ¶
type LoginAttempt struct {
ID string `json:"id" gorm:"primaryKey;size:36"`
UserID string `json:"user_id" gorm:"index;size:36"`
Username string `json:"username" gorm:"index;size:50"`
IP string `json:"ip" gorm:"index;size:50"`
UserAgent string `json:"user_agent" gorm:"size:500"`
Success bool `json:"success" gorm:"default:false"`
FailReason string `json:"fail_reason" gorm:"size:200"`
CreatedAt time.Time `json:"created_at" gorm:"index"`
}
LoginAttempt 登录尝试记录
type ModuleSetting ¶
type ModuleSetting struct {
ModuleID string `json:"module_id" gorm:"primaryKey;size:64"`
Enabled bool `json:"enabled" gorm:"default:false"`
Config JSONMap `json:"config" gorm:"type:text"` // 模块配置 JSON
UpdatedAt time.Time `json:"updated_at"`
}
ModuleSetting 模块设置
type ModuleSettingWithMeta ¶
type ModuleSettingWithMeta struct {
ModuleID string `json:"module_id"`
Name string `json:"name"`
Description string `json:"description"`
Category string `json:"category"` // "core" 或 "optional"
Enabled bool `json:"enabled"`
Dependencies []string `json:"dependencies"`
DepsSatisfied bool `json:"deps_satisfied"` // 依赖是否满足
Config JSONMap `json:"config"`
ConfigSchema []ConfigField `json:"config_schema"`
UpdatedAt time.Time `json:"updated_at"`
}
ModuleSettingWithMeta 带元信息的模块设置(用于 API 响应)
type MoveToTrashRequest ¶
type MoveToTrashRequest struct {
Paths []string `json:"paths" binding:"required"` // 要删除的路径列表
}
MoveToTrashRequest 移动到回收站请求
type NoIPConfig ¶
NoIPConfig No-IP 配置
type NotificationChannel ¶
type NotificationChannel struct {
ID string `json:"id" gorm:"primaryKey;size:36"`
Name string `json:"name" gorm:"size:100;not null"`
Type NotificationChannelType `json:"type" gorm:"size:20;not null"`
Enabled bool `json:"enabled" gorm:"default:false"`
Config string `json:"config" gorm:"type:text"` // JSON 配置
Description string `json:"description" gorm:"size:500"`
CreatedBy string `json:"created_by" gorm:"size:36"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
NotificationChannel 通知渠道配置
type NotificationChannelType ¶
type NotificationChannelType string
NotificationChannelType 通知渠道类型
const ( ChannelEmail NotificationChannelType = "email" ChannelWebhook NotificationChannelType = "webhook" ChannelTelegram NotificationChannelType = "telegram" ChannelWeChat NotificationChannelType = "wechat" ChannelBark NotificationChannelType = "bark" ChannelPushover NotificationChannelType = "pushover" )
type NotificationEvent ¶
type NotificationEvent struct {
Type NotificationEventType `json:"type"`
Title string `json:"title"`
Message string `json:"message"`
Data map[string]interface{} `json:"data"`
UserID string `json:"user_id"`
Timestamp time.Time `json:"timestamp"`
}
NotificationEvent 通知事件(用于触发通知)
type NotificationEventType ¶
type NotificationEventType string
NotificationEventType 通知事件类型
const ( EventUserLogin NotificationEventType = "user_login" EventUserLoginFailed NotificationEventType = "user_login_failed" EventAccountLocked NotificationEventType = "account_locked" EventBackupComplete NotificationEventType = "backup_complete" EventBackupFailed NotificationEventType = "backup_failed" EventStorageWarning NotificationEventType = "storage_warning" EventStorageCritical NotificationEventType = "storage_critical" EventSystemUpdate NotificationEventType = "system_update" EventSecurityAlert NotificationEventType = "security_alert" EventCustom NotificationEventType = "custom" )
type NotificationHistory ¶
type NotificationHistory struct {
ID string `json:"id" gorm:"primaryKey;size:36"`
RuleID string `json:"rule_id" gorm:"size:36;index"`
ChannelID string `json:"channel_id" gorm:"size:36;index"`
ChannelType NotificationChannelType `json:"channel_type" gorm:"size:20"`
EventType NotificationEventType `json:"event_type" gorm:"size:50;index"`
Title string `json:"title" gorm:"size:200"`
Content string `json:"content" gorm:"type:text"`
Recipient string `json:"recipient" gorm:"size:200"` // 接收者
Status string `json:"status" gorm:"size:20"` // pending, sent, failed
ErrorMsg string `json:"error_msg" gorm:"size:500"`
SentAt *time.Time `json:"sent_at"`
CreatedAt time.Time `json:"created_at" gorm:"index"`
}
NotificationHistory 通知历史
type NotificationRule ¶
type NotificationRule struct {
ID string `json:"id" gorm:"primaryKey;size:36"`
Name string `json:"name" gorm:"size:100;not null"`
EventType NotificationEventType `json:"event_type" gorm:"size:50;not null;index"`
ChannelID string `json:"channel_id" gorm:"size:36;not null;index"`
Enabled bool `json:"enabled" gorm:"default:true"`
Conditions string `json:"conditions" gorm:"type:text"` // JSON 条件
Template string `json:"template" gorm:"type:text"` // 自定义消息模板
Cooldown int `json:"cooldown" gorm:"default:0"` // 冷却时间(秒),防止频繁通知
LastSentAt *time.Time `json:"last_sent_at"`
CreatedBy string `json:"created_by" gorm:"size:36"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
NotificationRule 通知规则
type NotificationTemplate ¶
type NotificationTemplate struct {
ID string `json:"id" gorm:"primaryKey;size:36"`
Name string `json:"name" gorm:"size:100;not null"`
EventType NotificationEventType `json:"event_type" gorm:"size:50;index"`
Subject string `json:"subject" gorm:"size:200"` // 主题(邮件用)
Content string `json:"content" gorm:"type:text"` // 内容模板
ContentType string `json:"content_type" gorm:"size:20"` // text, html, markdown
IsDefault bool `json:"is_default" gorm:"default:false"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
NotificationTemplate 通知模板
type Obj ¶
type Obj interface {
GetSize() int64
GetName() string
ModTime() time.Time
IsDir() bool
// The internal information of the driver.
// If you want to use it, please understand what it means
GetID() string
GetPath() string
}
func UnwrapObjs ¶
type ObjMerge ¶
type ObjMerge struct {
// contains filtered or unexported fields
}
func (*ObjMerge) InitHideReg ¶
type ObjThumbURL ¶
type ObjWrapName ¶
func (*ObjWrapName) GetName ¶
func (o *ObjWrapName) GetName() string
func (*ObjWrapName) Unwrap ¶
func (o *ObjWrapName) Unwrap() Obj
type Object ¶
type PageResp ¶
type PageResp struct {
Content interface{} `json:"content"`
Total int64 `json:"total"`
}
type PasswordValidation ¶
PasswordValidation 密码验证结果
type PinAppRequest ¶
type PinAppRequest struct {
AppID string `json:"appId" binding:"required"`
}
PinAppRequest 固定应用请求
type PortAllocation ¶
type PortAllocation struct {
ID uint `json:"id" gorm:"primaryKey"`
Port int `json:"port" gorm:"uniqueIndex;not null"`
AppID string `json:"app_id" gorm:"index;not null"`
ServiceName string `json:"service_name"`
Protocol string `json:"protocol" gorm:"default:'tcp'"`
Description string `json:"description"`
}
PortAllocation 端口分配记录
type PreviewRequest ¶
type PreviewRequest struct {
Path string `json:"path" query:"path"`
Size int `json:"size" query:"size"` // 缩略图尺寸
}
PreviewRequest 预览请求
type ProxyAuth ¶
type ProxyAuth struct {
Username string `json:"username"`
Password string `json:"password"` // 存储时加密
}
ProxyAuth 代理认证信息
type ProxyTestRequest ¶
type ProxyTestRequest struct {
ProxyUrl string `json:"proxy_url"`
TestUrl string `json:"test_url"`
}
ProxyTestRequest 代理测试请求
type ProxyTestResponse ¶
type ProxyTestResponse struct {
Success bool `json:"success"`
Message string `json:"message"`
Latency int64 `json:"latency"` // 延迟毫秒
}
ProxyTestResponse 代理测试响应
type PushoverConfig ¶
PushoverConfig Pushover 配置
type RedisModel ¶
type RedisModel struct {
Host string
Password string
MaxIdle int
MaxActive int
IdleTimeout time.Duration
}
redis配置文件
type RemoteAccessSettings ¶
type RemoteAccessSettings struct {
SSHEnabled bool `json:"ssh_enabled"`
SSHRunning bool `json:"ssh_running"`
SSHPort int `json:"ssh_port"`
TerminalEnabled bool `json:"terminal_enabled"`
}
RemoteAccessSettings 远程访问设置
type ResourceUsage ¶
type ResourceUsage struct {
CPU string `json:"cpu"` // CPU 使用率,如 "2.5%"
Memory string `json:"memory"` // 内存使用量,如 "156MB"
MemoryPercent string `json:"memory_percent"` // 内存使用率,如 "3.2%"
NetworkRx string `json:"network_rx"` // 网络接收,如 "1.2GB"
NetworkTx string `json:"network_tx"` // 网络发送,如 "500MB"
}
ResourceUsage 应用资源使用情况
type Result ¶
type Result struct {
Success int `json:"success" example:"200"`
Message string `json:"message" example:"ok"`
Data interface{} `json:"data" example:"返回结果"`
}
公共返回模型
type SearchEngine ¶
type SecurityConfig ¶
type SecurityConfig struct {
ID string `json:"id" gorm:"primaryKey;size:36"`
// 登录失败锁定
MaxLoginAttempts int `json:"max_login_attempts" gorm:"default:5"` // 最大登录尝试次数
LockDuration time.Duration `json:"lock_duration" gorm:"-"` // 锁定时长
LockDurationMins int `json:"lock_duration_mins" gorm:"default:30"` // 锁定时长(分钟)
// 密码策略
PasswordMinLength int `json:"password_min_length" gorm:"default:8"` // 最小密码长度
PasswordRequireUpper bool `json:"password_require_upper" gorm:"default:true"` // 需要大写字母
PasswordRequireLower bool `json:"password_require_lower" gorm:"default:true"` // 需要小写字母
PasswordRequireNumber bool `json:"password_require_number" gorm:"default:true"` // 需要数字
PasswordRequireSpecial bool `json:"password_require_special" gorm:"default:false"` // 需要特殊字符
PasswordExpireDays int `json:"password_expire_days" gorm:"default:0"` // 密码过期天数,0=永不过期
// 会话
SessionTimeout int `json:"session_timeout" gorm:"default:1440"` // 会话超时(分钟),默认24小时
MaxConcurrentSessions int `json:"max_concurrent_sessions" gorm:"default:5"` // 最大并发会话数
// IP 限制
EnableIPWhitelist bool `json:"enable_ip_whitelist" gorm:"default:false"` // 启用 IP 白名单
EnableIPBlacklist bool `json:"enable_ip_blacklist" gorm:"default:false"` // 启用 IP 黑名单
IPWhitelist string `json:"ip_whitelist" gorm:"type:text"` // IP 白名单(JSON 数组)
IPBlacklist string `json:"ip_blacklist" gorm:"type:text"` // IP 黑名单(JSON 数组)
// 2FA
Require2FA bool `json:"require_2fa" gorm:"default:false"` // 强制启用 2FA
// 远程访问服务(默认关闭)
SSHEnabled bool `json:"ssh_enabled" gorm:"default:false"` // SSH 服务启用
TerminalEnabled bool `json:"terminal_enabled" gorm:"default:false"` // Web 终端启用
// 时间戳
UpdatedAt time.Time `json:"updated_at"`
}
SecurityConfig 安全配置
func (*SecurityConfig) GetLockDuration ¶
func (c *SecurityConfig) GetLockDuration() time.Duration
GetLockDuration 获取锁定时长
type SecurityEvent ¶
type SecurityEvent struct {
ID string `json:"id" gorm:"primaryKey;size:36"`
UserID string `json:"user_id" gorm:"index;size:36"`
Username string `json:"username" gorm:"size:50"`
EventType string `json:"event_type" gorm:"index;size:50;not null"` // login_failed, account_locked, suspicious_activity, etc.
Severity string `json:"severity" gorm:"size:20;default:info"` // info, warning, critical
IP string `json:"ip" gorm:"size:50"`
Description string `json:"description" gorm:"size:500"`
Details string `json:"details" gorm:"type:text"` // JSON 详细信息
Resolved bool `json:"resolved" gorm:"default:false"`
ResolvedBy string `json:"resolved_by" gorm:"size:36"`
ResolvedAt *time.Time `json:"resolved_at"`
CreatedAt time.Time `json:"created_at" gorm:"index"`
}
SecurityEvent 安全事件
type SecurityStatsResponse ¶
type SecurityStatsResponse struct {
TotalLoginAttempts int64 `json:"total_login_attempts"`
FailedLoginAttempts int64 `json:"failed_login_attempts"`
LockedAccounts int64 `json:"locked_accounts"`
ActiveSessions int64 `json:"active_sessions"`
TwoFactorEnabledUsers int64 `json:"two_factor_enabled_users"`
RecentEvents []*SecurityEvent `json:"recent_events"`
LoginAttemptsByDay map[string]int64 `json:"login_attempts_by_day"`
TopFailedIPs []IPFailedCount `json:"top_failed_ips"`
}
SecurityStatsResponse 安全统计响应
type SendNotificationRequest ¶
type SendNotificationRequest struct {
ChannelID string `json:"channel_id" validate:"required"`
Title string `json:"title" validate:"required"`
Content string `json:"content" validate:"required"`
Data map[string]interface{} `json:"data"`
}
SendNotificationRequest 发送通知请求
type ServerModel ¶
type ServerModel struct {
HttpPort string
RunMode string
ServerApi string
LockAccount bool
Token string
USBAutoMount string
UpdateUrl string
}
服务配置
type SettingItem ¶
type SettingItem struct {
Key string `json:"key" gorm:"primaryKey" binding:"required"` // unique key
Value string `json:"value"` // value
Help string `json:"help"` // help message
Type string `json:"type"` // string, number, bool, select
Options string `json:"options"` // values for select
Group int `json:"group"` // use to group setting in frontend
Flag int `json:"flag"` // 0 = public, 1 = private, 2 = readonly, 3 = deprecated, etc.
}
func (SettingItem) IsDeprecated ¶
func (s SettingItem) IsDeprecated() bool
type SystemApp ¶
type SystemApp struct {
ID uint `json:"id" gorm:"primaryKey;autoIncrement"`
AppID string `json:"app_id" gorm:"size:64;not null;uniqueIndex"`
Name string `json:"name" gorm:"size:128;not null"`
Icon string `json:"icon" gorm:"size:512;not null"`
Source string `json:"source" gorm:"size:32;not null;index"` // system, module, docker_store, linux_store, windows_store
ModuleDependency string `json:"module_dependency,omitempty" gorm:"size:64"`
LaunchType string `json:"launch_type" gorm:"size:32;not null"` // internal, docker, linux, windows
LaunchTarget string `json:"launch_target" gorm:"size:256;not null"`
State string `json:"state" gorm:"size:32;not null;default:'active';index"` // active, module_disabled, installing, uninstalling
Category string `json:"category,omitempty" gorm:"size:32"` // 开始菜单分类
Keywords string `json:"keywords,omitempty" gorm:"size:256"` // 搜索关键词, 逗号分隔
CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime"`
UpdatedAt time.Time `json:"updated_at" gorm:"autoUpdateTime"`
DeletedAt gorm.DeletedAt `json:"-" gorm:"index"`
}
SystemApp 系统/模块应用注册表
type SystemAppLaunchType ¶
type SystemAppLaunchType string
SystemAppLaunchType 系统应用启动类型
const ( SystemAppLaunchTypeInternal SystemAppLaunchType = "internal" SystemAppLaunchTypeDocker SystemAppLaunchType = "docker" SystemAppLaunchTypeLinux SystemAppLaunchType = "linux" SystemAppLaunchTypeWindows SystemAppLaunchType = "windows" )
type SystemAppSource ¶
type SystemAppSource string
SystemAppSource 系统应用来源类型
const ( SystemAppSourceSystem SystemAppSource = "system" SystemAppSourceModule SystemAppSource = "module" SystemAppSourceDockerStore SystemAppSource = "docker_store" SystemAppSourceLinuxStore SystemAppSource = "linux_store" SystemAppSourceWindowsStore SystemAppSource = "windows_store" )
type SystemAppState ¶
type SystemAppState string
SystemAppState 系统应用状态类型
const ( SystemAppStateActive SystemAppState = "active" SystemAppStateModuleDisabled SystemAppState = "module_disabled" SystemAppStateInstalling SystemAppState = "installing" SystemAppStateUninstalling SystemAppState = "uninstalling" )
type SystemConfig ¶
type SystemConfig struct {
ConfigPath string `json:"config_path"`
}
type SystemProxyConfig ¶
type SystemProxyConfig struct {
Mode ProxyMode `json:"mode"`
HttpProxy string `json:"http_proxy"`
HttpsProxy string `json:"https_proxy"`
Socks5 string `json:"socks5"`
NoProxy string `json:"no_proxy"`
PacUrl string `json:"pac_url"`
Auth *ProxyAuth `json:"auth,omitempty"`
DockerMirror string `json:"docker_mirror,omitempty"` // Docker Hub Registry Mirror URL
DockerProxyEnabled bool `json:"docker_proxy_enabled,omitempty"` // 让 Docker daemon 也使用系统代理
}
SystemProxyConfig 全局代理配置
type TaskPhase ¶
type TaskPhase string
TaskPhase 任务阶段
const ( TaskPhaseInit TaskPhase = "init" // 初始化 TaskPhasePullingImage TaskPhase = "pulling_image" // 拉取镜像 TaskPhaseCreatingNetwork TaskPhase = "creating_network" // 创建网络 TaskPhaseCreatingContainer TaskPhase = "creating_container" // 创建容器 TaskPhaseStartingContainer TaskPhase = "starting_container" // 启动容器 TaskPhaseCompleted TaskPhase = "completed" // 完成 TaskPhaseFailed TaskPhase = "failed" // 失败 )
type TaskStatus ¶
type TaskStatus string
TaskStatus 任务状态
const ( TaskStatusPending TaskStatus = "pending" // 排队中 TaskStatusRunning TaskStatus = "running" // 运行中 TaskStatusCompleted TaskStatus = "completed" // 已完成 TaskStatusFailed TaskStatus = "failed" // 失败 )
type TaskbarAppItem ¶
TaskbarAppItem 任务栏应用项
type TelegramConfig ¶
TelegramConfig Telegram 配置
type TestChannelRequest ¶
type TestChannelRequest struct {
ChannelID string `json:"channel_id" validate:"required"`
}
TestChannelRequest 测试通知渠道请求
type ThumbnailCache ¶
type ThumbnailCache struct {
ID string `json:"id" gorm:"primaryKey"`
FilePath string `json:"file_path" gorm:"index"`
FileHash string `json:"file_hash" gorm:"index"` // 原文件 MD5 用于检测变更
ThumbnailPath string `json:"thumbnail_path"`
Size int `json:"size"` // 缩略图尺寸
Width int `json:"width"`
Height int `json:"height"`
Format string `json:"format"` // jpeg, png, webp
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
ThumbnailCache 缩略图缓存记录
func (ThumbnailCache) TableName ¶
func (ThumbnailCache) TableName() string
type ThumbnailSize ¶
type ThumbnailSize int
ThumbnailSize 缩略图尺寸
const ( ThumbnailSmall ThumbnailSize = 128 // 小缩略图 ThumbnailMedium ThumbnailSize = 256 // 中等缩略图 ThumbnailLarge ThumbnailSize = 512 // 大缩略图 ThumbnailXLarge ThumbnailSize = 1024 // 特大缩略图 )
type TrashConfig ¶
type TrashConfig struct {
RetentionDays int `json:"retention_days"` // 保留天数,默认 30
MaxSize int64 `json:"max_size"` // 最大容量(字节),0=不限
Enabled bool `json:"enabled"` // 是否启用回收站
}
TrashConfig 回收站配置
type TrashItem ¶
type TrashItem struct {
ID string `json:"id" gorm:"primaryKey;size:36"`
UserID string `json:"user_id" gorm:"index;size:36"`
OriginalPath string `json:"original_path" gorm:"size:1024"` // 原始路径
TrashPath string `json:"trash_path" gorm:"size:1024"` // 回收站中的路径
FileName string `json:"file_name" gorm:"size:255"` // 文件名
IsDirectory bool `json:"is_directory"` // 是否为目录
Size int64 `json:"size"` // 文件大小
DeletedAt time.Time `json:"deleted_at" gorm:"index"` // 删除时间
ExpireAt time.Time `json:"expire_at" gorm:"index"` // 自动清理时间
}
TrashItem 回收站项目模型
type TrashListItem ¶
type TrashListItem struct {
ID string `json:"id"`
FileName string `json:"file_name"`
OriginalPath string `json:"original_path"`
IsDirectory bool `json:"is_directory"`
Size int64 `json:"size"`
DeletedAt time.Time `json:"deleted_at"`
ExpireAt time.Time `json:"expire_at"`
DaysLeft int `json:"days_left"` // 剩余天数
}
TrashListItem 回收站列表项(API 响应)
type TrashRestoreRequest ¶
type TrashRestoreRequest struct {
IDs []string `json:"ids" binding:"required"` // 要还原的项目 ID 列表
}
TrashRestoreRequest 回收站还原请求
type TrashStats ¶
type TrashStats struct {
TotalCount int64 `json:"total_count"` // 总数量
TotalSize int64 `json:"total_size"` // 总大小
FileCount int64 `json:"file_count"` // 文件数量
DirCount int64 `json:"dir_count"` // 目录数量
}
TrashStats 回收站统计
type UpdateChannelRequest ¶
type UpdateChannelRequest struct {
Name string `json:"name"`
Config interface{} `json:"config"`
Description string `json:"description"`
Enabled *bool `json:"enabled"`
}
UpdateChannelRequest 更新通知渠道请求
type UpdateDDNSConfigRequest ¶
type UpdateDDNSConfigRequest struct {
Name string `json:"name"`
Domain string `json:"domain"`
Subdomain string `json:"subdomain"`
Config interface{} `json:"config"`
UpdateInterval *int `json:"update_interval"`
Enabled *bool `json:"enabled"`
}
UpdateDDNSConfigRequest 更新 DDNS 配置请求
type UpdateDesktopIconsRequest ¶
type UpdateDesktopIconsRequest struct {
Icons []DesktopIconItem `json:"icons" binding:"required"`
}
UpdateDesktopIconsRequest 更新桌面图标请求
type UpdatePreferencesRequest ¶
type UpdatePreferencesRequest struct {
StartMenuPosition *string `json:"startMenuPosition,omitempty"`
PinnedApps []string `json:"pinnedApps,omitempty"`
TaskbarApps []TaskbarAppItem `json:"taskbarApps,omitempty"`
RecentApps []string `json:"recentApps,omitempty"`
}
UpdatePreferencesRequest 更新偏好请求
type UpdateRemoteAccessRequest ¶
type UpdateRemoteAccessRequest struct {
SSHEnabled *bool `json:"ssh_enabled"`
TerminalEnabled *bool `json:"terminal_enabled"`
Password string `json:"password" binding:"required"` // 二次确认密码
}
UpdateRemoteAccessRequest 更新远程访问设置请求
type UpdateRuleRequest ¶
type UpdateRuleRequest struct {
Name string `json:"name"`
Conditions map[string]interface{} `json:"conditions"`
Template string `json:"template"`
Cooldown *int `json:"cooldown"`
Enabled *bool `json:"enabled"`
}
UpdateRuleRequest 更新通知规则请求
type UpdateSecurityConfigRequest ¶
type UpdateSecurityConfigRequest struct {
MaxLoginAttempts *int `json:"max_login_attempts"`
LockDurationMins *int `json:"lock_duration_mins"`
PasswordMinLength *int `json:"password_min_length"`
PasswordRequireUpper *bool `json:"password_require_upper"`
PasswordRequireLower *bool `json:"password_require_lower"`
PasswordRequireNumber *bool `json:"password_require_number"`
PasswordRequireSpecial *bool `json:"password_require_special"`
PasswordExpireDays *int `json:"password_expire_days"`
SessionTimeout *int `json:"session_timeout"`
MaxConcurrentSessions *int `json:"max_concurrent_sessions"`
EnableIPWhitelist *bool `json:"enable_ip_whitelist"`
EnableIPBlacklist *bool `json:"enable_ip_blacklist"`
Require2FA *bool `json:"require_2fa"`
}
UpdateSecurityConfigRequest 更新安全配置请求
type UpdateTaskbarRequest ¶
type UpdateTaskbarRequest struct {
Apps []TaskbarAppItem `json:"apps" binding:"required"`
}
UpdateTaskbarRequest 更新任务栏请求
type UserActionStat ¶
type UserActionStat struct {
UserID string `json:"user_id"`
Username string `json:"username"`
Count int64 `json:"count"`
}
UserActionStat 用户操作统计
type UserPreference ¶
type UserPreference struct {
ID uint `json:"id" gorm:"primaryKey;autoIncrement"`
UserID string `json:"user_id" gorm:"size:36;not null;index:idx_user_key,unique"`
Key string `json:"key" gorm:"size:64;not null;index:idx_user_key,unique"`
Value string `json:"value" gorm:"type:text"` // JSON 格式存储
CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime"`
UpdatedAt time.Time `json:"updated_at" gorm:"autoUpdateTime"`
DeletedAt gorm.DeletedAt `json:"-" gorm:"index"`
}
UserPreference 用户偏好配置
type UserPreferencesResponse ¶
type UserPreferencesResponse struct {
StartMenuPosition string `json:"startMenuPosition"`
PinnedApps []string `json:"pinnedApps"`
TaskbarApps []TaskbarAppItem `json:"taskbarApps"`
DesktopIcons []DesktopIconItem `json:"desktopIcons"`
RecentApps []string `json:"recentApps"`
}
UserPreferencesResponse 用户偏好响应
type VerifyPasswordRequest ¶
type VerifyPasswordRequest struct {
Password string `json:"password" binding:"required"`
}
VerifyPasswordRequest 验证密码请求
type VideoMetadata ¶
type VideoMetadata struct {
Duration float64 `json:"duration"` // 时长(秒)
Width int `json:"width"` // 宽度
Height int `json:"height"` // 高度
Codec string `json:"codec"` // 编解码器
Bitrate int64 `json:"bitrate"` // 比特率
FrameRate float64 `json:"frame_rate"` // 帧率
AudioCodec string `json:"audio_codec"` // 音频编解码器
AudioRate int `json:"audio_rate"` // 音频采样率
HasSubtitle bool `json:"has_subtitle"` // 是否有字幕
}
VideoMetadata 视频元数据
type WeChatConfig ¶
type WeChatConfig struct {
WebhookURL string `json:"webhook_url"` // 企业微信机器人 Webhook URL
}
WeChatConfig 微信配置(企业微信机器人)
type WebhookConfig ¶
type WebhookConfig struct {
URL string `json:"url"`
Method string `json:"method"` // POST, GET
Headers map[string]string `json:"headers"`
ContentType string `json:"content_type"` // application/json, application/x-www-form-urlencoded
Template string `json:"template"` // 消息模板
}
WebhookConfig Webhook 配置