temporal

package
v0.6.1 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: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServerTaskQueue = "fallbck-server-queue"
)

Variables

This section is empty.

Functions

func CheckHealth

func CheckHealth(ctx context.Context, c client.Client) error

CheckHealth verifies connection to Temporal cluster

func DialWithRetry

func DialWithRetry(ctx context.Context, dial func() (client.Client, error)) (client.Client, error)

DialWithRetry retries dial until it succeeds or ctx expires

func NewClient

func NewClient(cfg config.TemporalConfig) (client.Client, error)

NewClient initializes a Temporal SDK client for an external cluster, with optional (m)TLS

func NewLoopbackClient

func NewLoopbackClient(hostPort, namespace string) (client.Client, error)

NewLoopbackClient connects to the embedded (loopback, plaintext) Temporal frontend

Types

type BackupExecutionResult

type BackupExecutionResult struct {
	Status        db.RunStatus  `json:"status"`
	BytesScanned  int64         `json:"bytes_scanned"`
	BytesUploaded int64         `json:"bytes_uploaded"`
	DedupRatio    float64       `json:"dedup_ratio"`
	ChunkCount    int           `json:"chunk_count"`
	SnapshotID    string        `json:"snapshot_id"`
	ErrorMessage  string        `json:"error_message,omitempty"`
	Duration      time.Duration `json:"duration"`
}

BackupExecutionResult contains the outcome and metrics of a backup run

type BackupHeartbeatProgress

type BackupHeartbeatProgress struct {
	CurrentFile   string  `json:"current_file"`
	BytesScanned  int64   `json:"bytes_scanned"`
	BytesUploaded int64   `json:"bytes_uploaded"`
	Percent       float64 `json:"percent"`
}

BackupHeartbeatProgress is sent periodically during execution

type BackupSessionInfo

type BackupSessionInfo struct {
	JobID          uuid.UUID `json:"job_id"`
	AgentID        uuid.UUID `json:"agent_id"`
	TargetID       uuid.UUID `json:"target_id"`
	AgentTaskQueue string    `json:"agent_task_queue"`
	ProxyURL       string    `json:"proxy_url"`
	Ticket         string    `json:"ticket"`
	Datastore      string    `json:"datastore"`
	Namespace      string    `json:"namespace"`
	// Snapshot identity the server opens on PBS (also bound into the ticket)
	BackupType string `json:"backup_type"`
	BackupID   string `json:"backup_id"`
	BackupTime int64  `json:"backup_time"`
	// PxarFormat is "v1" or "v2" (target setting)
	PxarFormat string `json:"pxar_format"`
	// DirectPBS: the agent fetches PBS credentials with its ticket and connects to PBS
	// itself instead of through the server tunnel (job setting)
	DirectPBS bool `json:"direct_pbs"`
	// JobType is filesystem or database; database jobs carry DBConfig (password
	// redacted — the agent fetches it with its ticket when DBPasswordOnServer is set)
	JobType            string         `json:"job_type,omitempty"`
	DBConfig           *dbbackup.Spec `json:"db_config,omitempty"`
	DBPasswordOnServer bool           `json:"db_password_on_server,omitempty"`
	// JobName is informational (manifest)
	JobName         string             `json:"job_name,omitempty"`
	BackupPaths     []string           `json:"backup_paths"`
	ExcludePaths    []string           `json:"exclude_paths"`
	RetentionPolicy db.RetentionPolicy `json:"retention_policy"`
	WorkflowID      string             `json:"workflow_id"`
	RunID           string             `json:"run_id"`
	BackupRunID     uuid.UUID          `json:"backup_run_id"`
}

BackupSessionInfo carries all configuration needed for a worker to execute a backup

type ServerWorker

type ServerWorker struct {
	// contains filtered or unexported fields
}

ServerWorker manages the Temporal worker for server workflows and server activities

func NewServerWorker

func NewServerWorker(c client.Client, database *db.DB, cfg *config.ServerConfig, tm *auth.TokenManager) *ServerWorker

NewServerWorker initializes the server-side Temporal workflow and activity worker

func (*ServerWorker) Register

func (sw *ServerWorker) Register(workflowFunc interface{}, serverActivities interface{})

RegisterWorkflowAndActivities registers workflows and server activities

func (*ServerWorker) Start

func (sw *ServerWorker) Start() error

Start launches the worker in the background

func (*ServerWorker) Stop

func (sw *ServerWorker) Stop()

Stop halts the worker gracefully

Directories

Path Synopsis
Package embedded runs the Temporal server in-process inside fallbck-server.
Package embedded runs the Temporal server in-process inside fallbck-server.
Package ui embeds the Temporal Web UI (temporalio/ui-server) in fallbck-server.
Package ui embeds the Temporal Web UI (temporalio/ui-server) in fallbck-server.

Jump to

Keyboard shortcuts

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