activities

package
v0.6.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2026 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const ErrTypeBackupFailed = "backup_failed"

ErrTypeBackupFailed marks a failed (but retryable) backup activity; the error carries temporal.BackupFailureDetails for the workflow.

View Source
const ErrTypeDBPrecheckFailed = "db_precheck_failed"

ErrTypeDBPrecheckFailed marks configuration/precheck failures of database backups; the workflow does not retry them.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentActivities

type AgentActivities struct {
	// Tunnel is the agent's gRPC connection to the FallBCK server (carrying its bearer
	// token); PBS backup sessions are opened through it.
	Tunnel grpc.ClientConnInterface
	// Workers bounds concurrent chunk uploads (0 = default)
	Workers int
	// Credentials fetches PBS connection details for jobs in direct mode
	// (GET /api/v1/agents/pbs-credentials with the run's ticket)
	Credentials func(ctx context.Context, ticket string) (*backup.DirectOptions, error)
	// LogTail returns the agent's recent log output, attached to failures
	LogTail func() string
}

AgentActivities provides activities executed on the client backup agent host

func NewAgentActivities

func NewAgentActivities() *AgentActivities

NewAgentActivities creates a new AgentActivities instance

func (*AgentActivities) ExecuteFilesystemBackup

func (a *AgentActivities) ExecuteFilesystemBackup(ctx context.Context, session *temporal.BackupSessionInfo) (*temporal.BackupExecutionResult, error)

ExecuteFilesystemBackup performs the filesystem backup on the agent host, streaming into PBS through the server-side tunnel.

type DBAgentActivities added in v0.6.0

type DBAgentActivities struct {
	// Tunnel is the agent's gRPC connection to the FallBCK server (PBS sessions)
	Tunnel grpc.ClientConnInterface
	// Workers bounds concurrent chunk uploads (0 = default)
	Workers int
	// Credentials fetches PBS connection details for jobs in direct mode
	Credentials func(ctx context.Context, ticket string) (*backup.DirectOptions, error)
	// DBPassword fetches the server-stored database password for a run
	DBPassword func(ctx context.Context, ticket string) (string, error)
	// Config is the agent's db_backup configuration (defaults applied)
	Config   dbbackup.Config
	Hostname string
	Version  string
	// LogTail returns the agent's recent log output, attached to failures
	LogTail func() string
}

DBAgentActivities are the activities of fallbck-db-agent

func NewDBAgentActivities added in v0.6.0

func NewDBAgentActivities() *DBAgentActivities

NewDBAgentActivities creates a new DBAgentActivities instance

func (*DBAgentActivities) ExecuteDatabaseBackup added in v0.6.0

func (a *DBAgentActivities) ExecuteDatabaseBackup(ctx context.Context, session *temporal.BackupSessionInfo) (*temporal.BackupExecutionResult, error)

ExecuteDatabaseBackup dumps the job's databases into the spool directory and uploads the result to PBS (through the server tunnel or directly).

type ServerActivities

type ServerActivities struct {
	DB           *db.DB
	Config       *config.ServerConfig
	TokenManager *auth.TokenManager
}

ServerActivities provides activities executed on the central FallBCK server

func NewServerActivities

func NewServerActivities(database *db.DB, cfg *config.ServerConfig, tm *auth.TokenManager) *ServerActivities

NewServerActivities creates a new ServerActivities instance

func (*ServerActivities) FinalizeBackupRun

func (s *ServerActivities) FinalizeBackupRun(ctx context.Context, session *temporal.BackupSessionInfo, result *temporal.BackupExecutionResult) error

FinalizeBackupRun updates the backup run record in the database with results and deduplication metrics

func (*ServerActivities) PrepareBackupSession

func (s *ServerActivities) PrepareBackupSession(ctx context.Context, jobID uuid.UUID) (*temporal.BackupSessionInfo, error)

PrepareBackupSession validates job parameters and generates a short-lived backup ticket

func (*ServerActivities) PruneJob

func (s *ServerActivities) PruneJob(ctx context.Context, session *temporal.BackupSessionInfo) error

PruneJob executes the retention policy prune on the target Proxmox Backup Server

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL