Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthConfig ¶
type AuthConfig struct {
Type string `yaml:"type"` // auto, password, key
Password string `yaml:"password"` // 密码(不加密存储)
IdentityFile string `yaml:"identity_file"` // 密钥文件路径
}
AuthConfig 认证配置
type Config ¶
type Config struct {
Version string `yaml:"version"`
Sync SyncConfig `yaml:"sync"`
Servers []Server `yaml:"servers"`
}
Config 主配置结构
func (*Config) FilterServers ¶
FilterServers 根据标签和分组过滤服务器
type Server ¶
type Server struct {
Name string `yaml:"name"`
Hostname string `yaml:"hostname"`
User string `yaml:"user"`
Port int `yaml:"port"`
Description string `yaml:"description"`
Tags []string `yaml:"tags"`
Group string `yaml:"group"` // 分组
Auth AuthConfig `yaml:"auth"`
LastUsed string `yaml:"last_used"`
CreatedAt string `yaml:"created_at"`
}
Server 服务器配置
func (*Server) GetDisplayName ¶
GetDisplayName 获取显示名称(包含描述)
type SyncConfig ¶
type SyncConfig struct {
Enabled bool `yaml:"enabled"`
Type string `yaml:"type"` // ssh, http, ftp (未来扩展)
SSHHost string `yaml:"ssh_host"` // SSH同步时的主机地址
SSHUser string `yaml:"ssh_user"` // SSH同步时的用户名
SSHPath string `yaml:"ssh_path"` // SSH同步时的远程路径
SSHKey string `yaml:"ssh_key"` // SSH密钥路径(可选)
Password string `yaml:"password"` // 密码(可选,用于SSH认证)
AutoSync bool `yaml:"auto_sync"` // 启动时自动同步
LastSync string `yaml:"last_sync"` // 最后同步时间
}
SyncConfig 同步配置
Click to show internal directories.
Click to hide internal directories.