Documentation
¶
Index ¶
- type App
- type AppSlug
- type AppSlugs
- type AppUpdateOrder
- type AppUpdateShow
- type BackupCreate
- type BackupFile
- type BackupList
- type BackupRestore
- type BackupStorageCreate
- type BackupStorageUpdate
- type BackupUpload
- type CertAccountCreate
- type CertAccountUpdate
- type CertCreate
- type CertDNSCreate
- type CertDNSUpdate
- type CertDeploy
- type CertUpdate
- type CertUpload
- type ChunkUploadFinish
- type ChunkUploadStart
- type ContainerComposeCreate
- type ContainerComposeDown
- type ContainerComposeGet
- type ContainerComposeRemove
- type ContainerComposeUp
- type ContainerComposeUpdate
- type ContainerCreate
- type ContainerID
- type ContainerImageID
- type ContainerImagePull
- type ContainerNetworkCreate
- type ContainerNetworkID
- type ContainerRename
- type ContainerVolumeCreate
- type ContainerVolumeID
- type CronCreate
- type CronStatus
- type CronUpdate
- type DatabaseComment
- type DatabaseCreate
- type DatabaseDelete
- type DatabaseList
- type DatabaseRedisClear
- type DatabaseRedisData
- type DatabaseRedisDatabases
- type DatabaseRedisKeyDelete
- type DatabaseRedisKeyGet
- type DatabaseRedisKeyRename
- type DatabaseRedisKeySet
- type DatabaseRedisKeyTTL
- type DatabaseServerCreate
- type DatabaseServerUpdate
- type DatabaseServerUpdateRemark
- type DatabaseUserCreate
- type DatabaseUserUpdate
- type DatabaseUserUpdateRemark
- type EnvironmentAction
- type EnvironmentMirror
- type EnvironmentPHPConfigTune
- type EnvironmentPHPModule
- type EnvironmentPHPUpdateConfig
- type EnvironmentPHPVersion
- type EnvironmentProxy
- type EnvironmentRegistry
- type EnvironmentSlug
- type FileCompress
- type FileControl
- type FileCreate
- type FileList
- type FilePath
- type FilePermission
- type FileRemoteDownload
- type FileSave
- type FileUnCompress
- type FirewallForward
- type FirewallIPRule
- type FirewallRule
- type FirewallScanSetting
- type FirewallStatus
- type HomeCurrent
- type HomeTopProcesses
- type ID
- type LogDates
- type LogList
- type MonitorList
- type MonitorSetting
- type Paginate
- type ProcessDetail
- type ProcessKill
- type ProcessList
- type ProcessSignal
- type ProjectCreate
- type ProjectUpdate
- type SSHCreate
- type SSHUpdate
- type SafeUpdatePingStatus
- type SafeUpdateSSH
- type SettingCert
- type SettingMemo
- type SettingPanel
- type SystemctlService
- type TemplateCreate
- type TemplateSlug
- type ToolboxBenchmarkTest
- type ToolboxDiskDevice
- type ToolboxDiskExtendLV
- type ToolboxDiskFormat
- type ToolboxDiskFstabDelete
- type ToolboxDiskFstabEntry
- type ToolboxDiskInit
- type ToolboxDiskLV
- type ToolboxDiskLVPath
- type ToolboxDiskMount
- type ToolboxDiskUmount
- type ToolboxDiskVG
- type ToolboxDiskVGName
- type ToolboxLogClean
- type ToolboxMigrationConnection
- type ToolboxMigrationDatabase
- type ToolboxMigrationDatabaseUser
- type ToolboxMigrationExec
- type ToolboxMigrationItems
- type ToolboxMigrationProject
- type ToolboxMigrationWebsite
- type ToolboxNetworkList
- type ToolboxSSHPasswordAuth
- type ToolboxSSHPort
- type ToolboxSSHPubKeyAuth
- type ToolboxSSHRootLogin
- type ToolboxSSHRootPassword
- type ToolboxSystemDNS
- type ToolboxSystemHostname
- type ToolboxSystemHosts
- type ToolboxSystemNTPServers
- type ToolboxSystemPassword
- type ToolboxSystemSWAP
- type ToolboxSystemSyncTime
- type ToolboxSystemTime
- type ToolboxSystemTimezone
- type UserCreate
- type UserID
- type UserIsTwoFA
- type UserLogin
- type UserTokenCreate
- type UserTokenList
- type UserTokenUpdate
- type UserUpdateEmail
- type UserUpdatePassword
- type UserUpdateTwoFA
- type UserUpdateUsername
- type WebHookCreate
- type WebHookKey
- type WebHookUpdate
- type WebsiteCreate
- type WebsiteCustomConfig
- type WebsiteDefaultConfig
- type WebsiteDelete
- type WebsiteList
- type WebsiteStatDateRange
- type WebsiteStatErrors
- type WebsiteStatGeo
- type WebsiteStatPaginate
- type WebsiteStatSetting
- type WebsiteStatSlowURIs
- type WebsiteUpdate
- type WebsiteUpdateCert
- type WebsiteUpdateRemark
- type WebsiteUpdateStatus
- type WithAuthorize
- type WithFilters
- type WithMessages
- type WithPrepare
- type WithRules
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppSlugs ¶
type AppSlugs struct {
Slugs string `json:"slugs" form:"slugs" validate:"required"`
}
type AppUpdateOrder ¶
type AppUpdateOrder struct {
Slugs []string `json:"slugs" form:"slugs" validate:"required"`
}
type AppUpdateShow ¶
type BackupCreate ¶
type BackupFile ¶
type BackupList ¶
type BackupList struct {
Type string `uri:"type" form:"type" validate:"required|in:path,website,mysql,postgres,redis,panel"`
}
type BackupRestore ¶
type BackupRestore struct {
BackupFile
Target string `json:"target" form:"target" validate:"required|regex:^[a-zA-Z0-9_-]+$"`
}
type BackupStorageCreate ¶
type BackupStorageCreate struct {
Type string `form:"type" json:"type" validate:"required|in:s3,sftp,webdav"`
Name string `form:"name" json:"name" validate:"required"`
Info types.BackupStorageInfo `form:"info" json:"info"`
}
type BackupStorageUpdate ¶
type BackupStorageUpdate struct {
ID uint `form:"id" json:"id" validate:"required|exists:backup_storages,id"`
Type string `form:"type" json:"type" validate:"required|in:s3,sftp,webdav"`
Name string `form:"name" json:"name" validate:"required"`
Info types.BackupStorageInfo `form:"info" json:"info"`
}
type BackupUpload ¶
type BackupUpload struct {
Type string `uri:"type" form:"type"` // 校验没有必要,因为根本没经过验证器
File *multipart.FileHeader `form:"file"`
}
type CertAccountCreate ¶
type CertAccountCreate struct {
CA string `form:"ca" json:"ca" validate:"required|in:googlecn,google,letsencrypt,litessl,buypass,zerossl,sslcom"`
Email string `form:"email" json:"email" validate:"required"`
Kid string `form:"kid" json:"kid"`
HmacEncoded string `form:"hmac_encoded" json:"hmac_encoded"`
KeyType string `form:"key_type" json:"key_type" validate:"required|in:P256,P384,2048,3072,4096"`
}
type CertAccountUpdate ¶
type CertAccountUpdate struct {
ID uint `form:"id" json:"id" validate:"required|exists:cert_accounts,id"`
CA string `form:"ca" json:"ca" validate:"required|in:googlecn,google,letsencrypt,litessl,buypass,zerossl,sslcom"`
Email string `form:"email" json:"email" validate:"required"`
Kid string `form:"kid" json:"kid"`
HmacEncoded string `form:"hmac_encoded" json:"hmac_encoded"`
KeyType string `form:"key_type" json:"key_type" validate:"required|in:P256,P384,2048,3072,4096"`
}
type CertCreate ¶
type CertCreate struct {
Type string `form:"type" json:"type" validate:"required|in:P256,P384,2048,3072,4096"`
Domains []string `form:"domains" json:"domains" validate:"required|isSlice"`
AutoRenewal bool `form:"auto_renewal" json:"auto_renewal"`
AccountID uint `form:"account_id" json:"account_id"`
DNSID uint `form:"dns_id" json:"dns_id"`
WebsiteID uint `form:"website_id" json:"website_id"`
}
type CertDNSCreate ¶
type CertDNSUpdate ¶
type CertDNSUpdate struct {
ID uint `form:"id" json:"id" validate:"required|exists:cert_dns,id"`
Type acme.DnsType `form:"type" json:"type" validate:"required|in:aliyun,tencent,huawei,westcn,cloudflare,gcore,porkbun,namesilo,cloudns"`
Name string `form:"name" json:"name" validate:"required"`
Data acme.DNSParam `form:"data" json:"data" validate:"required"`
}
type CertDeploy ¶
type CertUpdate ¶
type CertUpdate struct {
ID uint `form:"id" json:"id" validate:"required|exists:certs,id"`
Type string `form:"type" json:"type" validate:"required|in:P256,P384,2048,3072,4096,upload"`
Domains []string `form:"domains" json:"domains" validate:"required|isSlice"`
Cert string `form:"cert" json:"cert"`
Key string `form:"key" json:"key"`
Script string `form:"script" json:"script"`
AutoRenewal bool `form:"auto_renewal" json:"auto_renewal"`
AccountID uint `form:"account_id" json:"account_id"`
DNSID uint `form:"dns_id" json:"dns_id"`
WebsiteID uint `form:"website_id" json:"website_id"`
}
type CertUpload ¶
type ChunkUploadFinish ¶
type ChunkUploadFinish struct {
Path string `json:"path" validate:"required|isUnixPath"` // 目标目录
FileName string `json:"file_name" validate:"required"` // 文件名
FileHash string `json:"file_hash" validate:"required|len:64"` // 文件SHA256
ChunkCount int `json:"chunk_count" validate:"required|min:1"` // 分块总数
Force bool `json:"force"` // 是否覆盖已存在文件
}
ChunkUploadFinish 分块上传完成请求
type ChunkUploadStart ¶
type ChunkUploadStart struct {
Path string `json:"path" validate:"required|isUnixPath"` // 目标目录
FileName string `json:"file_name" validate:"required"` // 文件名
FileHash string `json:"file_hash" validate:"required|len:64"` // 文件SHA256
ChunkCount int `json:"chunk_count" validate:"required|min:1"` // 分块总数
Force bool `json:"force"` // 是否覆盖已存在文件
}
ChunkUploadStart 分块上传开始请求
type ContainerComposeCreate ¶
type ContainerComposeDown ¶
type ContainerComposeDown struct {
Name string `uri:"name" validate:"required|regex:^[a-zA-Z0-9_-]+$"`
}
type ContainerComposeGet ¶
type ContainerComposeGet struct {
Name string `uri:"name" validate:"required|regex:^[a-zA-Z0-9_-]+$"`
}
type ContainerComposeRemove ¶
type ContainerComposeRemove struct {
Name string `uri:"name" validate:"required|regex:^[a-zA-Z0-9_-]+$"`
}
type ContainerComposeUp ¶
type ContainerComposeUpdate ¶
type ContainerCreate ¶
type ContainerCreate struct {
Name string `form:"name" json:"name"`
Image string `form:"image" json:"image" validate:"required"`
Ports []types.ContainerPort `form:"ports" json:"ports"`
Network string `form:"network" json:"network"`
Volumes []types.ContainerContainerVolume `form:"volumes" json:"volumes"`
Labels []types.KV `form:"labels" json:"labels"`
Env []types.KV `form:"env" json:"env"`
Entrypoint []string `form:"entrypoint" json:"entrypoint"`
Command []string `form:"command" json:"command"`
RestartPolicy string `form:"restart_policy" json:"restart_policy"`
AutoRemove bool `form:"auto_remove" json:"auto_remove"`
Privileged bool `form:"privileged" json:"privileged"`
OpenStdin bool `form:"openStdin" json:"open_stdin"`
PublishAllPorts bool `form:"publish_all_ports" json:"publish_all_ports"`
Tty bool `form:"tty" json:"tty"`
CPUs int64 `form:"cpus" json:"cpus"`
Memory int64 `form:"memory" json:"memory"`
}
type ContainerID ¶
type ContainerID struct {
ID string `json:"id" form:"id" validate:"required"`
}
type ContainerImageID ¶
type ContainerImageID struct {
ID string `json:"id" form:"id"`
}
type ContainerImagePull ¶
type ContainerNetworkCreate ¶
type ContainerNetworkCreate struct {
Name string `form:"name" json:"name" validate:"required|regex:^[a-zA-Z0-9_-]+$"`
Driver string `form:"driver" json:"driver" validate:"required|in:bridge,host,overlay,macvlan,ipvlan,none"`
Ipv4 types.ContainerContainerNetwork `form:"ipv4" json:"ipv4"`
Ipv6 types.ContainerContainerNetwork `form:"ipv6" json:"ipv6"`
Labels []types.KV `form:"labels" json:"labels"`
Options []types.KV `form:"options" json:"options"`
}
type ContainerNetworkID ¶
type ContainerNetworkID struct {
ID string `json:"id" form:"id" validate:"required"`
}
type ContainerRename ¶
type ContainerVolumeCreate ¶
type ContainerVolumeID ¶
type ContainerVolumeID struct {
ID string `json:"id" form:"id" validate:"required"`
}
type CronCreate ¶
type CronCreate struct {
Name string `form:"name" json:"name" validate:"required|notExists:crons,name"`
Type string `form:"type" json:"type" validate:"required"`
Time string `form:"time" json:"time" validate:"required|cron"`
Script string `form:"script" json:"script"`
SubType string `form:"sub_type" json:"sub_type" validate:"requiredIf:Type,backup,cutoff"`
Flock bool `form:"flock" json:"flock"`
Storage uint `form:"storage" json:"storage"`
Targets []string `form:"targets" json:"targets" validate:"requiredIf:Type,backup,cutoff"`
Keep uint `form:"keep" json:"keep" validate:"required"`
URL string `form:"url" json:"url"`
Method string `form:"method" json:"method"`
Headers map[string]string `form:"headers" json:"headers"`
Body string `form:"body" json:"body"`
Timeout uint `form:"timeout" json:"timeout"`
Insecure bool `form:"insecure" json:"insecure"`
Retries uint `form:"retries" json:"retries"`
}
type CronStatus ¶
type CronUpdate ¶
type CronUpdate struct {
ID uint `form:"id" json:"id" validate:"required|exists:crons,id"`
Name string `form:"name" json:"name" validate:"required"`
Type string `form:"type" json:"type" validate:"required"`
Time string `form:"time" json:"time" validate:"required|cron"`
Script string `form:"script" json:"script"`
SubType string `form:"sub_type" json:"sub_type"`
Flock bool `form:"flock" json:"flock"`
Storage uint `form:"storage" json:"storage"`
Targets []string `form:"targets" json:"targets"`
Keep uint `form:"keep" json:"keep"`
URL string `form:"url" json:"url"`
Method string `form:"method" json:"method"`
Headers map[string]string `form:"headers" json:"headers"`
Body string `form:"body" json:"body"`
Timeout uint `form:"timeout" json:"timeout"`
Insecure bool `form:"insecure" json:"insecure"`
Retries uint `form:"retries" json:"retries"`
}
type DatabaseComment ¶
type DatabaseCreate ¶
type DatabaseCreate struct {
ServerID uint `form:"server_id" json:"server_id" validate:"required|exists:database_servers,id"`
Name string `form:"name" json:"name" validate:"required|regex:^[a-zA-Z0-9_-]+$"`
CreateUser bool `form:"create_user" json:"create_user"`
Username string `form:"username" json:"username" validate:"requiredIf:CreateUser,true|not_in:root,admin|regex:^[a-zA-Z0-9_-]+$"`
Password string `form:"password" json:"password" validate:"requiredIf:CreateUser,true"`
Host string `form:"host" json:"host"`
Comment string `form:"comment" json:"comment"`
}
type DatabaseDelete ¶
type DatabaseList ¶
type DatabaseRedisClear ¶
type DatabaseRedisData ¶
type DatabaseRedisDatabases ¶
type DatabaseRedisDatabases struct {
ServerID uint `form:"server_id" json:"server_id" query:"server_id" validate:"required|exists:database_servers,id"`
}
type DatabaseRedisKeyDelete ¶
type DatabaseRedisKeyGet ¶
type DatabaseRedisKeyRename ¶
type DatabaseRedisKeySet ¶
type DatabaseRedisKeySet struct {
ServerID uint `form:"server_id" json:"server_id" validate:"required|exists:database_servers,id"`
DB int `form:"db" json:"db"`
Key string `form:"key" json:"key" validate:"required"`
Value string `form:"value" json:"value" validate:"required"`
Type string `form:"type" json:"type" validate:"required|in:string,list,set,zset,hash"`
TTL int64 `form:"ttl" json:"ttl"`
}
type DatabaseRedisKeyTTL ¶
type DatabaseServerCreate ¶
type DatabaseServerCreate struct {
Name string `form:"name" json:"name" validate:"required|notExists:database_servers,name|regex:^[a-zA-Z0-9_-]+$"`
Type string `form:"type" json:"type" validate:"required|in:mysql,postgresql,redis"`
Host string `form:"host" json:"host" validate:"required"`
Port uint `form:"port" json:"port" validate:"required|min:1|max:65535"`
Username string `form:"username" json:"username"`
Password string `form:"password" json:"password"`
Remark string `form:"remark" json:"remark"`
}
type DatabaseServerUpdate ¶
type DatabaseServerUpdate struct {
ID uint `form:"id" json:"id" validate:"required|exists:database_servers,id"`
Name string `form:"name" json:"name" validate:"required|regex:^[a-zA-Z0-9_-]+$"`
Host string `form:"host" json:"host" validate:"required"`
Port uint `form:"port" json:"port" validate:"required|min:1|max:65535"`
Username string `form:"username" json:"username"`
Password string `form:"password" json:"password"`
Remark string `form:"remark" json:"remark"`
}
type DatabaseUserCreate ¶
type DatabaseUserCreate struct {
ServerID uint `form:"server_id" json:"server_id" validate:"required|exists:database_servers,id"`
Username string `form:"username" json:"username" validate:"required|not_in:root,admin|regex:^[a-zA-Z0-9_-]+$"`
Password string `form:"password" json:"password" validate:"required"`
Host string `form:"host" json:"host"`
Privileges []string `form:"privileges" json:"privileges"`
Remark string `form:"remark" json:"remark"`
}
type DatabaseUserUpdate ¶
type EnvironmentAction ¶
EnvironmentAction 环境操作请求
type EnvironmentMirror ¶
type EnvironmentMirror struct {
Slug string `json:"slug"`
Mirror string `form:"mirror" json:"mirror" validate:"required"`
}
EnvironmentMirror Python 镜像设置请求
type EnvironmentPHPConfigTune ¶
type EnvironmentPHPConfigTune struct {
Version uint `json:"version"`
// php.ini 常规设置
ShortOpenTag string `form:"short_open_tag" json:"short_open_tag"`
DateTimezone string `form:"date_timezone" json:"date_timezone"`
DisplayErrors string `form:"display_errors" json:"display_errors"`
ErrorReporting string `form:"error_reporting" json:"error_reporting"`
// php.ini 禁用函数
DisableFunctions string `form:"disable_functions" json:"disable_functions"`
// php.ini 上传限制
UploadMaxFilesize string `form:"upload_max_filesize" json:"upload_max_filesize"`
PostMaxSize string `form:"post_max_size" json:"post_max_size"`
MaxFileUploads string `form:"max_file_uploads" json:"max_file_uploads"`
MemoryLimit string `form:"memory_limit" json:"memory_limit"`
// php.ini 超时限制
MaxExecutionTime string `form:"max_execution_time" json:"max_execution_time"`
MaxInputTime string `form:"max_input_time" json:"max_input_time"`
MaxInputVars string `form:"max_input_vars" json:"max_input_vars"`
// php.ini Session 相关
SessionSaveHandler string `form:"session_save_handler" json:"session_save_handler"`
SessionSavePath string `form:"session_save_path" json:"session_save_path"`
SessionGcMaxlifetime string `form:"session_gc_maxlifetime" json:"session_gc_maxlifetime"`
SessionCookieLifetime string `form:"session_cookie_lifetime" json:"session_cookie_lifetime"`
// php-fpm.conf 相关
Pm string `form:"pm" json:"pm"`
PmMaxChildren string `form:"pm_max_children" json:"pm_max_children"`
PmStartServers string `form:"pm_start_servers" json:"pm_start_servers"`
PmMinSpareServers string `form:"pm_min_spare_servers" json:"pm_min_spare_servers"`
PmMaxSpareServers string `form:"pm_max_spare_servers" json:"pm_max_spare_servers"`
}
EnvironmentPHPConfigTune PHP 配置调整
type EnvironmentPHPModule ¶
type EnvironmentPHPVersion ¶
type EnvironmentPHPVersion struct {
Version uint `json:"version"`
}
type EnvironmentProxy ¶
type EnvironmentProxy struct {
Slug string `json:"slug"`
Proxy string `form:"proxy" json:"proxy" validate:"required"`
}
EnvironmentProxy Go 代理设置请求
type EnvironmentRegistry ¶
type EnvironmentRegistry struct {
Slug string `json:"slug"`
Registry string `form:"registry" json:"registry" validate:"required"`
}
EnvironmentRegistry Node.js 镜像设置请求
type EnvironmentSlug ¶
type EnvironmentSlug struct {
Slug string `json:"slug"`
}
EnvironmentSlug 环境版本请求(通用)
type FileCompress ¶
type FileControl ¶
type FileCreate ¶
type FileList ¶
type FilePath ¶
type FilePath struct {
Path string `json:"path" form:"path" validate:"required|isUnixPath"`
}
type FilePermission ¶
type FileRemoteDownload ¶
type FileUnCompress ¶
type FirewallForward ¶
type FirewallIPRule ¶
type FirewallIPRule struct {
Family string `json:"family" validate:"required|in:ipv4,ipv6"`
Protocol string `json:"protocol" validate:"required|in:tcp,udp,tcp/udp"`
Address string `json:"address"`
Strategy string `json:"strategy" validate:"required|in:accept,drop,reject"`
Direction string `json:"direction" validate:"required|in:in,out"`
}
type FirewallRule ¶
type FirewallRule struct {
Type string `json:"type"`
Family string `json:"family" validate:"required|in:ipv4,ipv6"`
PortStart uint `json:"port_start" validate:"required|min:1|max:65535"`
PortEnd uint `json:"port_end" validate:"required|min:1|max:65535"`
Protocol string `json:"protocol" validate:"required|in:tcp,udp,tcp/udp"`
Address string `json:"address"`
Strategy string `json:"strategy" validate:"required|in:accept,drop,reject"`
Direction string `json:"direction" validate:"required|in:in,out"`
}
type FirewallScanSetting ¶
type FirewallScanSetting struct {
Enabled bool `json:"enabled"`
Days uint `json:"days" validate:"min:1|max:365"`
Interfaces []string `json:"interfaces"`
}
FirewallScanSetting 扫描感知设置
type FirewallStatus ¶
type FirewallStatus struct {
Status bool `json:"status" form:"status"`
}
type HomeCurrent ¶
type HomeTopProcesses ¶
type HomeTopProcesses struct {
Type string `json:"type" form:"type" query:"type" validate:"in:cpu,memory,disk_io"`
}
type ID ¶
type ID struct {
ID uint `json:"id" form:"id" query:"id" uri:"id" validate:"required|min:1"`
}
type LogDates ¶
type LogDates struct {
Type string `json:"type" form:"type" query:"type" validate:"required|in:app,db,http"`
}
LogDates 日志日期列表请求
type LogList ¶
type LogList struct {
Type string `json:"type" form:"type" query:"type" validate:"required|in:app,db,http"`
Limit int `json:"limit" form:"limit" query:"limit" validate:"min:1|max:1000"`
Date string `json:"date" form:"date" query:"date"` // 日期,格式为 YYYY-MM-DD,空表示当天
}
LogList 日志列表请求
type MonitorList ¶
type MonitorSetting ¶
type Paginate ¶
type ProcessDetail ¶
type ProcessDetail struct {
PID int32 `json:"pid" form:"pid" query:"pid" validate:"required"`
}
ProcessDetail 获取进程详情请求
type ProcessKill ¶
type ProcessKill struct {
PID int32 `json:"pid" validate:"required"`
}
ProcessKill 结束进程请求
type ProcessList ¶
type ProcessList struct {
Page uint `json:"page" form:"page" query:"page"`
Limit uint `json:"limit" form:"limit" query:"limit"`
Sort string `json:"sort" form:"sort" query:"sort" validate:"in:pid,name,cpu,rss,start_time,ppid,num_threads"`
Order string `json:"order" form:"order" query:"order" validate:"in:asc,desc"`
Status string `json:"status" form:"status" query:"status" validate:"in:R,S,T,I,Z,W,L"`
Keyword string `json:"keyword" form:"keyword" query:"keyword"`
}
ProcessList 进程列表请求
type ProcessSignal ¶
type ProcessSignal struct {
PID int32 `json:"pid" validate:"required"`
Signal int `json:"signal" validate:"required|in:1,2,9,10,12,15,18,19"`
}
ProcessSignal 发送信号请求 支持的信号: SIGHUP(1), SIGINT(2), SIGKILL(9), SIGUSR1(10), SIGUSR2(12), SIGTERM(15), SIGCONT(18), SIGSTOP(19)
type ProjectCreate ¶
type ProjectCreate struct {
Name string `form:"name" json:"name" validate:"required|regex:^[a-zA-Z0-9_-]+$"`
Type types.ProjectType `form:"type" json:"type" validate:"required|in:general,php,java,go,python,nodejs,dotnet"`
Description string `form:"description" json:"description"`
RootDir string `form:"root_dir" json:"root_dir"`
WorkingDir string `form:"working_dir" json:"working_dir"`
ExecStart string `form:"exec_start" json:"exec_start"`
User string `form:"user" json:"user"`
Restart string `json:"restart"`
Environments []types.KV
}
type ProjectUpdate ¶
type ProjectUpdate struct {
ID uint `form:"id" json:"id" validate:"required|exists:projects,id"`
Name string `form:"name" json:"name" validate:"required|regex:^[a-zA-Z0-9_-]+$"`
Description string `form:"description" json:"description"`
RootDir string `form:"root_dir" json:"root_dir" validate:"required"`
WorkingDir string `form:"working_dir" json:"working_dir"`
ExecStartPre string `form:"exec_start_pre" json:"exec_start_pre"`
ExecStartPost string `form:"exec_start_post" json:"exec_start_post"`
ExecStart string `form:"exec_start" json:"exec_start"`
ExecStop string `form:"exec_stop" json:"exec_stop"`
ExecReload string `form:"exec_reload" json:"exec_reload"`
User string `form:"user" json:"user"`
Restart string `json:"restart"`
RestartSec string `json:"restart_sec"`
RestartMax int `json:"restart_max"`
TimeoutStartSec int `json:"timeout_start_sec"`
TimeoutStopSec int `json:"timeout_stop_sec"`
Environments []types.KV `form:"environments" json:"environments"`
StandardOutput string `form:"standard_output" json:"standard_output"`
StandardError string `form:"standard_error" json:"standard_error"`
Requires []string `form:"requires" json:"requires"`
Wants []string `form:"wants" json:"wants"`
After []string `form:"after" json:"after"`
Before []string `form:"before" json:"before"`
MemoryLimit float64 `form:"memory_limit" json:"memory_limit"`
CPUQuota string `form:"cpu_quota" json:"cpu_quota"`
NoNewPrivileges bool `form:"no_new_privileges" json:"no_new_privileges"`
ProtectTmp bool `form:"protect_tmp" json:"protect_tmp"`
ProtectHome bool `form:"protect_home" json:"protect_home"`
ProtectSystem string `form:"protect_system" json:"protect_system"`
ReadWritePaths []string `form:"read_write_paths" json:"read_write_paths"`
ReadOnlyPaths []string `form:"read_only_paths" json:"read_only_paths"`
}
type SSHCreate ¶
type SSHCreate struct {
Name string `json:"name" form:"name"`
Host string `json:"host" form:"host" validate:"required"`
Port uint `json:"port" form:"port" validate:"required|min:1|max:65535"`
AuthMethod string `json:"auth_method" form:"auth_method" validate:"required|in:password,publickey"`
User string `json:"user" form:"user" validate:"required"`
Password string `json:"password" form:"password" validate:"requiredIf:AuthMethod,password"`
Key string `json:"key" form:"key" validate:"requiredIf:AuthMethod,publickey"`
Passphrase string `json:"passphrase" form:"passphrase"`
Remark string `json:"remark" form:"remark"`
}
type SSHUpdate ¶
type SSHUpdate struct {
ID uint `form:"id" json:"id" validate:"required|exists:sshes,id"`
Name string `json:"name" form:"name"`
Host string `json:"host" form:"host" validate:"required"`
Port uint `json:"port" form:"port" validate:"required|min:1|max:65535"`
AuthMethod string `json:"auth_method" form:"auth_method" validate:"required|in:password,publickey"`
User string `json:"user" form:"user" validate:"required"`
Password string `json:"password" form:"password" validate:"requiredIf:AuthMethod,password"`
Key string `json:"key" form:"key" validate:"requiredIf:AuthMethod,publickey"`
Passphrase string `json:"passphrase" form:"passphrase"`
Remark string `json:"remark" form:"remark"`
}
type SafeUpdatePingStatus ¶
type SafeUpdatePingStatus struct {
Status bool `json:"status" form:"status"`
}
type SafeUpdateSSH ¶
type SettingCert ¶
type SettingMemo ¶
type SettingMemo struct {
Content string `json:"content"`
}
type SettingPanel ¶
type SettingPanel struct {
Name string `json:"name" validate:"required"`
Channel string `json:"channel" validate:"required|in:stable,beta"`
Locale string `json:"locale" validate:"required"`
Entrance string `json:"entrance" validate:"required"`
EntranceError string `json:"entrance_error" validate:"in:418,nginx,close"` // 安全入口错误页伪装类型
LoginCaptcha bool `json:"login_captcha"` // 登录验证码
OfflineMode bool `json:"offline_mode"`
AutoUpdate bool `json:"auto_update"`
TwoFA bool `json:"two_fa"`
Lifetime uint `json:"lifetime" validate:"required|min:10|max:43200"` // 登录超时,单位:分
IPHeader string `json:"ip_header"`
BindDomain []string `json:"bind_domain"`
BindIP []string `json:"bind_ip"`
BindUA []string `json:"bind_ua"`
WebsitePath string `json:"website_path" validate:"required"`
BackupPath string `json:"backup_path" validate:"required"`
ProjectPath string `json:"project_path" validate:"required"`
ContainerSock string `json:"container_sock"`
HiddenMenu []string `json:"hidden_menu"` // 隐藏的菜单项
CustomLogo string `json:"custom_logo" validate:"isFullURL"` // 自定义 Logo URL
IPDBType string `json:"ipdb_type"` // IPDB 来源类型: "" / "custom" / "subscribe"
IPDBURL string `json:"ipdb_url"` // IPDB 订阅链接
IPDBPath string `json:"ipdb_path"` // IPDB 地理位置库路径
Port uint `json:"port" validate:"required|min:1|max:65535"`
HTTPS bool `json:"https"`
ACME bool `json:"acme"`
PublicIP []string `json:"public_ip"`
Cert string `json:"cert" validate:"required"`
Key string `json:"key" validate:"required"`
}
type SystemctlService ¶
type SystemctlService struct {
Service string `json:"service" validate:"required"`
}
type TemplateCreate ¶
type TemplateSlug ¶
type TemplateSlug struct {
Slug string `uri:"slug" validate:"required"`
}
type ToolboxBenchmarkTest ¶
type ToolboxBenchmarkTest struct {
Name string `json:"name" validate:"required|in:image,machine,compile,encryption,compression,physics,json,memory,disk"`
}
type ToolboxDiskDevice ¶
type ToolboxDiskDevice struct {
Device string `form:"device" json:"device" validate:"required"`
}
ToolboxDiskDevice 磁盘设备请求
type ToolboxDiskExtendLV ¶
type ToolboxDiskExtendLV struct {
Path string `form:"path" json:"path" validate:"required|isUnixPath"`
Size int `form:"size" json:"size" validate:"required|min:1"`
Resize bool `form:"resize" json:"resize"`
}
ToolboxDiskExtendLV 扩容逻辑卷请求
type ToolboxDiskFormat ¶
type ToolboxDiskFormat struct {
Device string `form:"device" json:"device" validate:"required"`
FsType string `form:"fs_type" json:"fs_type" validate:"required|in:ext4,ext3,xfs,btrfs"`
}
ToolboxDiskFormat 格式化请求
type ToolboxDiskFstabDelete ¶
type ToolboxDiskFstabDelete struct {
MountPoint string `form:"mount_point" json:"mount_point" validate:"required"`
}
ToolboxDiskFstabDelete 删除 fstab 条目请求
type ToolboxDiskFstabEntry ¶
type ToolboxDiskFstabEntry struct {
Device string `json:"device"` // 设备(UUID=xxx 或 /dev/xxx)
MountPoint string `json:"mount_point"` // 挂载点
FsType string `json:"fs_type"` // 文件系统类型
Options string `json:"options"` // 挂载选项
Dump string `json:"dump"` // 备份标志
Pass string `json:"pass"` // 检查顺序
}
ToolboxDiskFstabEntry fstab 条目结构
type ToolboxDiskInit ¶
type ToolboxDiskInit struct {
Device string `form:"device" json:"device" validate:"required"`
FsType string `form:"fs_type" json:"fs_type" validate:"required|in:ext4,ext3,xfs,btrfs"`
}
ToolboxDiskInit 初始化磁盘请求
type ToolboxDiskLV ¶
type ToolboxDiskLV struct {
Name string `form:"name" json:"name" validate:"required"`
VGName string `form:"vg_name" json:"vg_name" validate:"required"`
Size int `form:"size" json:"size" validate:"required|min:1"`
}
ToolboxDiskLV 逻辑卷请求
type ToolboxDiskLVPath ¶
type ToolboxDiskLVPath struct {
Path string `form:"path" json:"path" validate:"required|isUnixPath"`
}
ToolboxDiskLVPath 逻辑卷路径请求
type ToolboxDiskMount ¶
type ToolboxDiskMount struct {
Device string `form:"device" json:"device" validate:"required"`
Path string `form:"path" json:"path" validate:"required|isUnixPath"`
WriteFstab bool `form:"write_fstab" json:"write_fstab"`
MountOption string `form:"mount_option" json:"mount_option"`
}
ToolboxDiskMount 挂载请求
type ToolboxDiskUmount ¶
type ToolboxDiskUmount struct {
Path string `form:"path" json:"path" validate:"required|isUnixPath"`
}
ToolboxDiskUmount 卸载请求
type ToolboxDiskVG ¶
type ToolboxDiskVG struct {
Name string `form:"name" json:"name" validate:"required"`
Devices []string `form:"devices" json:"devices" validate:"required"`
}
ToolboxDiskVG 卷组请求
type ToolboxDiskVGName ¶
type ToolboxDiskVGName struct {
Name string `form:"name" json:"name" validate:"required"`
}
ToolboxDiskVGName 卷组名称请求
type ToolboxLogClean ¶
type ToolboxLogClean struct {
Type string `form:"type" json:"type" validate:"required|in:panel,website,mysql,docker,system"`
}
ToolboxLogClean 日志清理请求
type ToolboxMigrationConnection ¶
type ToolboxMigrationConnection struct {
URL string `json:"url" validate:"required"`
TokenID uint `json:"token_id" validate:"required"`
Token string `json:"token" validate:"required"`
}
ToolboxMigrationConnection 迁移连接信息
type ToolboxMigrationDatabase ¶
type ToolboxMigrationDatabase struct {
Type string `json:"type"` // mysql / postgresql
Name string `json:"name"`
ServerID uint `json:"server_id"`
Server string `json:"server"` // 服务器名称
}
ToolboxMigrationDatabase 迁移数据库项
type ToolboxMigrationDatabaseUser ¶
type ToolboxMigrationDatabaseUser struct {
ID uint `json:"id"`
Username string `json:"username"`
Password string `json:"password"`
Host string `json:"host"` // 仅 mysql
ServerID uint `json:"server_id"`
Server string `json:"server"` // 服务器名称
Type string `json:"type"` // mysql / postgresql
}
ToolboxMigrationDatabaseUser 迁移数据库用户项
type ToolboxMigrationExec ¶
type ToolboxMigrationExec struct {
Command string `json:"command" validate:"required"`
}
ToolboxMigrationExec 远程执行命令请求
type ToolboxMigrationItems ¶
type ToolboxMigrationItems struct {
Websites []ToolboxMigrationWebsite `json:"websites"`
Databases []ToolboxMigrationDatabase `json:"databases"`
DatabaseUsers []ToolboxMigrationDatabaseUser `json:"database_users"`
Projects []ToolboxMigrationProject `json:"projects"`
StopOnMig bool `json:"stop_on_mig"` // 迁移中是否停止服务
}
ToolboxMigrationItems 迁移选择项
type ToolboxMigrationProject ¶
type ToolboxMigrationProject struct {
ID uint `json:"id"`
Name string `json:"name"`
Path string `json:"path"` // 项目目录
}
ToolboxMigrationProject 迁移项目项
type ToolboxMigrationWebsite ¶
type ToolboxMigrationWebsite struct {
ID uint `json:"id"`
Name string `json:"name"`
Path string `json:"path"` // 网站目录
}
ToolboxMigrationWebsite 迁移网站项
type ToolboxNetworkList ¶
type ToolboxNetworkList struct {
Page uint `json:"page" form:"page" query:"page"`
Limit uint `json:"limit" form:"limit" query:"limit"`
Sort string `json:"sort" form:"sort" query:"sort" validate:"in:type,pid,process"`
Order string `json:"order" form:"order" query:"order" validate:"in:asc,desc"`
State string `json:"state" form:"state" query:"state"` // 逗号分隔多选: LISTEN,ESTABLISHED
PID string `json:"pid" form:"pid" query:"pid"` // PID 搜索
Process string `json:"process" form:"process" query:"process"` // 进程名称搜索
Port string `json:"port" form:"port" query:"port"` // 端口搜索
}
ToolboxNetworkList 网络连接列表请求
type ToolboxSSHPasswordAuth ¶
type ToolboxSSHPasswordAuth struct {
Enabled bool `form:"enabled" json:"enabled"`
}
ToolboxSSHPasswordAuth SSH 密码认证设置
type ToolboxSSHPort ¶
type ToolboxSSHPort struct {
Port uint `form:"port" json:"port" validate:"required|min:1|max:65535"`
}
ToolboxSSHPort SSH 端口设置
type ToolboxSSHPubKeyAuth ¶
type ToolboxSSHPubKeyAuth struct {
Enabled bool `form:"enabled" json:"enabled"`
}
ToolboxSSHPubKeyAuth SSH 密钥认证设置
type ToolboxSSHRootLogin ¶
type ToolboxSSHRootLogin struct {
Mode string `form:"mode" json:"mode" validate:"required|in:yes,no,prohibit-password,forced-commands-only"`
}
ToolboxSSHRootLogin Root 登录设置
type ToolboxSSHRootPassword ¶
type ToolboxSSHRootPassword struct {
Password string `form:"password" json:"password" validate:"required|password"`
}
ToolboxSSHRootPassword Root 密码设置
type ToolboxSystemDNS ¶
type ToolboxSystemHostname ¶
type ToolboxSystemHostname struct {
Hostname string `form:"hostname" json:"hostname" validate:"required|regex:^[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]$"`
}
type ToolboxSystemHosts ¶
type ToolboxSystemHosts struct {
Hosts string `form:"hosts" json:"hosts"`
}
type ToolboxSystemNTPServers ¶
type ToolboxSystemNTPServers struct {
Servers []string `form:"servers" json:"servers" validate:"required"`
}
type ToolboxSystemPassword ¶
type ToolboxSystemPassword struct {
Password string `form:"password" json:"password" validate:"required|password"`
}
type ToolboxSystemSWAP ¶
type ToolboxSystemSWAP struct {
Size int64 `form:"size" json:"size" validate:"min:0"`
}
type ToolboxSystemSyncTime ¶
type ToolboxSystemSyncTime struct {
Server string `form:"server" json:"server"` // 可选的 NTP 服务器地址
}
type ToolboxSystemTime ¶
type ToolboxSystemTimezone ¶
type ToolboxSystemTimezone struct {
Timezone string `form:"timezone" json:"timezone" validate:"required"`
}
type UserCreate ¶
type UserIsTwoFA ¶
type UserIsTwoFA struct {
Username string `query:"username" validate:"required"`
}
type UserLogin ¶
type UserLogin struct {
Username string `json:"username" validate:"required"` // encrypted with RSA-OAEP
Password string `json:"password" validate:"required"` // encrypted with RSA-OAEP
SafeLogin bool `json:"safe_login"`
PassCode string `json:"pass_code"` // 2FA
CaptchaCode string `json:"captcha_code"` // 验证码
}
type UserTokenCreate ¶
type UserTokenList ¶
type UserTokenUpdate ¶
type UserUpdateEmail ¶
type UserUpdatePassword ¶
type UserUpdateTwoFA ¶
type UserUpdateUsername ¶
type WebHookCreate ¶
type WebHookKey ¶
type WebHookKey struct {
Key string `json:"key" form:"key" uri:"key" validate:"required"`
}
type WebHookUpdate ¶
type WebHookUpdate struct {
ID uint `json:"id" form:"id" uri:"id" validate:"required|exists:web_hooks,id"`
Name string `json:"name" form:"name" validate:"required"`
Script string `json:"script" form:"script" validate:"required"`
Raw bool `json:"raw" form:"raw"`
User string `json:"user" form:"user" validate:"required"`
Status bool `json:"status" form:"status"`
}
type WebsiteCreate ¶
type WebsiteCreate struct {
Type string `json:"type" form:"type" validate:"required|in:proxy,static,php"`
Name string `form:"name" json:"name" validate:"required|notExists:websites,name|not_in:phpmyadmin,default|regex:^[a-zA-Z0-9_-]+$"`
Listens []string `form:"listens" json:"listens" validate:"required|isSlice"`
Domains []string `form:"domains" json:"domains" validate:"required|isSlice"`
Path string `form:"path" json:"path"`
DB bool `form:"db" json:"db"`
DBType string `form:"db_type" json:"db_type" validate:"requiredIf:DB,true"`
DBName string `form:"db_name" json:"db_name" validate:"requiredIf:DB,true"`
DBUser string `form:"db_user" json:"db_user" validate:"requiredIf:DB,true"`
DBPassword string `form:"db_password" json:"db_password" validate:"requiredIf:DB,true"`
Remark string `form:"remark" json:"remark"`
PHP uint `form:"php" json:"php" validate:"requiredIf:Type,php"` // 仅 PHP 网站需要
Proxy string `form:"proxy" json:"proxy" validate:"requiredIf:Type,proxy"` // 仅反向代理网站需要
}
type WebsiteCustomConfig ¶
type WebsiteCustomConfig struct {
Name string `json:"name" validate:"required|regex:^[a-zA-Z0-9_-]+$"` // 配置名称
Scope string `json:"scope" validate:"required|in:site,shared"` // 作用域: site(此网站), shared(全局)
Content string `json:"content"` // 配置内容
}
WebsiteCustomConfig 网站自定义配置请求
type WebsiteDefaultConfig ¶
type WebsiteDefaultConfig struct {
Index string `json:"index" form:"index" validate:"required"`
Stop string `json:"stop" form:"stop" validate:"required"`
NotFound string `json:"not_found" form:"not_found"`
TLSVersions []string `json:"tls_versions" form:"tls_versions" validate:"required|isSlice"`
CipherSuites string `json:"cipher_suites" form:"cipher_suites" validate:"required"`
}
type WebsiteDelete ¶
type WebsiteList ¶
type WebsiteStatDateRange ¶
type WebsiteStatDateRange struct {
Start string `json:"start" form:"start" query:"start"`
End string `json:"end" form:"end" query:"end"`
Sites string `json:"sites" form:"sites" query:"sites"`
}
WebsiteStatDateRange 统计日期范围查询参数
func (*WebsiteStatDateRange) Prepare ¶
func (r *WebsiteStatDateRange) Prepare(_ *http.Request) error
func (*WebsiteStatDateRange) SiteList ¶
func (r *WebsiteStatDateRange) SiteList() []string
SiteList 解析逗号分隔的站点列表
type WebsiteStatErrors ¶
type WebsiteStatErrors struct {
WebsiteStatPaginate
Status int `json:"status" form:"status" query:"status"`
}
WebsiteStatErrors 错误日志查询参数
type WebsiteStatGeo ¶
type WebsiteStatGeo struct {
WebsiteStatDateRange
GroupBy string `json:"group_by" form:"group_by" query:"group_by"`
Country string `json:"country" form:"country" query:"country"`
Limit uint `json:"limit" form:"limit" query:"limit"`
}
WebsiteStatGeo 地理位置统计查询参数
type WebsiteStatPaginate ¶
type WebsiteStatPaginate struct {
WebsiteStatDateRange
Page uint `json:"page" form:"page" query:"page"`
Limit uint `json:"limit" form:"limit" query:"limit"`
}
WebsiteStatPaginate 统计分页查询参数
type WebsiteStatSetting ¶
type WebsiteStatSetting struct {
Days uint `json:"days" validate:"required|min:1|max:365"`
ErrBufMax int `json:"err_buf_max" validate:"min:0|max:1000000"`
UVMaxKeys int `json:"uv_max_keys" validate:"min:0|max:100000000"`
IPMaxKeys int `json:"ip_max_keys" validate:"min:0|max:100000000"`
DetailMaxKeys int `json:"detail_max_keys" validate:"min:0|max:100000000"`
BodyEnabled bool `json:"body_enabled"`
}
WebsiteStatSetting 网站统计设置
type WebsiteStatSlowURIs ¶
type WebsiteStatSlowURIs struct {
WebsiteStatPaginate
Threshold uint `json:"threshold" form:"threshold" query:"threshold"`
}
WebsiteStatSlowURIs 慢请求统计查询参数
type WebsiteUpdate ¶
type WebsiteUpdate struct {
ID uint `form:"id" json:"id" validate:"required|exists:websites,id"`
Listens []types.Listen `form:"listens" json:"listens" validate:"required|isSlice"`
Domains []string `form:"domains" json:"domains" validate:"required|isSlice"`
Path string `form:"path" json:"path" validate:"required"` // 网站目录
Root string `form:"root" json:"root" validate:"required"` // 运行目录
Index []string `form:"index" json:"index" validate:"required|isSlice"`
// SSL 相关
SSL bool `form:"ssl" json:"ssl"`
SSLCert string `json:"ssl_cert"`
SSLKey string `json:"ssl_key"`
HSTS bool `form:"hsts" json:"hsts"`
OCSP bool `form:"ocsp" json:"ocsp"`
HTTPRedirect bool `form:"http_redirect" json:"http_redirect"`
SSLProtocols []string `json:"ssl_protocols"`
SSLCiphers string `json:"ssl_ciphers"`
// PHP 相关
PHP uint `form:"php" json:"php"`
Rewrite string `form:"rewrite" json:"rewrite"`
OpenBasedir bool `form:"open_basedir" json:"open_basedir"`
// 反向代理
Upstreams []types.Upstream `json:"upstreams"`
Proxies []types.Proxy `json:"proxies"`
// 重定向
Redirects []types.Redirect `json:"redirects"`
// 高级设置
StatEnabled bool `json:"stat_enabled"` // 是否启用访问统计
AccessLog string `json:"access_log"` // 访问日志路径
ErrorLog string `json:"error_log"` // 错误日志路径
RateLimit *types.RateLimit `json:"rate_limit"` // 限流限速配置
RealIP *types.RealIP `json:"real_ip"` // 真实 IP 配置
BasicAuth map[string]string `json:"basic_auth"` // 基本认证配置
// 自定义配置
CustomConfigs []WebsiteCustomConfig `json:"custom_configs"`
}
type WebsiteUpdateCert ¶
type WebsiteUpdateRemark ¶
type WebsiteUpdateStatus ¶
type WithAuthorize ¶
type WithPrepare ¶
Source Files
¶
- app.go
- backup.go
- backup_storage.go
- cert.go
- cert_account.go
- cert_dns.go
- common.go
- container.go
- container_compose.go
- container_image.go
- container_network.go
- container_volume.go
- cron.go
- database.go
- database_redis.go
- database_server.go
- database_user.go
- environment.go
- environment_common.go
- environment_php.go
- file.go
- firewall.go
- firewall_scan.go
- home.go
- log.go
- monitor.go
- paginate.go
- process.go
- project.go
- request.go
- safe.go
- setting.go
- ssh.go
- systemctl.go
- template.go
- toolbox_benchmark.go
- toolbox_disk.go
- toolbox_log.go
- toolbox_migration.go
- toolbox_network.go
- toolbox_ssh.go
- toolbox_system.go
- user.go
- user_token.go
- webhook.go
- website.go
- website_stat.go