Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultPort = 19284
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentStatus ¶
type AgentStatus struct {
Version string `json:"version"`
AgentID string `json:"agent_id"`
AgentName string `json:"agent_name"`
Online bool `json:"online"` // WebSocket connected
Uptime string `json:"uptime"`
LastBackupAt string `json:"last_backup_at"`
RepoCount int `json:"repo_count"`
Platform string `json:"platform"`
Arch string `json:"arch"`
ResticVersion string `json:"restic_version"`
APIURL string `json:"api_url"`
}
type BackupProgress ¶
type BackupProgress struct {
RepoID string `json:"repo_id"`
JobID string `json:"job_id,omitempty"`
PercentDone float64 `json:"percent_done"`
BytesDone int64 `json:"bytes_done"`
FilesDone int `json:"files_done"`
CurrentFile string `json:"current_file,omitempty"`
StartedAt string `json:"started_at"`
}
type RepoStatus ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func New ¶
func New(provider StatusProvider) *Server
type StatusProvider ¶
type StatusProvider interface {
GetStatus() AgentStatus
GetRepos() []RepoStatus
GetProgress() *BackupProgress
TriggerBackup(repoID string) error
}
StatusProvider is implemented by the scheduler to expose state to the local API.
Click to show internal directories.
Click to hide internal directories.