Documentation
¶
Index ¶
- type Scheduler
- func (s *Scheduler) GetProgress() *localapi.BackupProgress
- func (s *Scheduler) GetRepos() []localapi.RepoStatus
- func (s *Scheduler) GetStatus() localapi.AgentStatus
- func (s *Scheduler) HandleCommand(cmd ws.Command)
- func (s *Scheduler) SetVersionInfo(agentVersion, resticVersion string)
- func (s *Scheduler) SetWSClient(wsClient *ws.Client)
- func (s *Scheduler) Start(ctx context.Context)
- func (s *Scheduler) TriggerBackup(repoID string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
Scheduler syncs config from the API and manages cron-scheduled backups.
func New ¶
func New(client *api.Client, resticBinary, agentID string, cfg *config.AgentConfig, syncInterval time.Duration) *Scheduler
New creates a scheduler.
func (*Scheduler) GetProgress ¶ added in v0.12.1
func (s *Scheduler) GetProgress() *localapi.BackupProgress
GetProgress returns the live progress of the current backup, or nil if idle.
func (*Scheduler) GetRepos ¶ added in v0.12.1
func (s *Scheduler) GetRepos() []localapi.RepoStatus
GetRepos returns the status of all configured repos for the local API.
func (*Scheduler) GetStatus ¶ added in v0.12.1
func (s *Scheduler) GetStatus() localapi.AgentStatus
GetStatus returns the current agent status for the local API.
func (*Scheduler) HandleCommand ¶ added in v0.5.0
HandleCommand processes a command received from the WebSocket server. Commands are dispatched from the server (dashboard/API) to the agent in real time.
func (*Scheduler) SetVersionInfo ¶ added in v0.12.1
SetVersionInfo sets the agent and restic version strings, exposed via the local API.
func (*Scheduler) SetWSClient ¶ added in v0.5.0
SetWSClient sets the WebSocket client used for real-time progress streaming.
func (*Scheduler) TriggerBackup ¶ added in v0.12.1
TriggerBackup starts an ad-hoc backup for the given repo ID via the local API.