Files
backrest/proto/v1/restic.proto

85 lines
2.3 KiB
Protocol Buffer

syntax = "proto3";
package v1;
option go_package = "github.com/garethgeorge/backrest/gen/go/v1";
// ResticSnapshot represents a restic snapshot.
message ResticSnapshot {
string id = 1;
int64 unix_time_ms = 2;
string hostname = 3;
string username = 4;
string tree = 5; // tree hash
string parent = 6; // parent snapshot's id
repeated string paths = 7;
repeated string tags = 8;
}
// ResticSnapshotList represents a list of restic snapshots.
message ResticSnapshotList {
repeated ResticSnapshot snapshots = 1;
}
// BackupProgressEntriy represents a single entry in the backup progress stream.
message BackupProgressEntry {
oneof entry {
BackupProgressStatusEntry status = 1;
BackupProgressSummary summary = 2;
}
}
// BackupProgressStatusEntry represents a single status entry in the backup progress stream.
message BackupProgressStatusEntry {
// See https://restic.readthedocs.io/en/stable/075_scripting.html#id1
double percent_done = 1; // 0.0 - 1.0
int64 total_files = 2;
int64 total_bytes = 3;
int64 files_done = 4;
int64 bytes_done = 5;
repeated string current_file = 6;
}
// BackupProgressSummary represents a the summary event emitted at the end of a backup stream.
message BackupProgressSummary {
// See https://restic.readthedocs.io/en/stable/075_scripting.html#summary
int64 files_new = 1;
int64 files_changed = 2;
int64 files_unmodified = 3;
int64 dirs_new = 4;
int64 dirs_changed = 5;
int64 dirs_unmodified = 6;
int64 data_blobs = 7;
int64 tree_blobs = 8;
int64 data_added = 9;
int64 total_files_processed = 10;
int64 total_bytes_processed = 11;
double total_duration = 12;
string snapshot_id = 13;
}
message BackupProgressError {
// See https://restic.readthedocs.io/en/stable/075_scripting.html#error
string item = 1;
string during = 2;
string message = 3;
}
// RestoreProgressEvent represents a single entry in the restore progress stream.
message RestoreProgressEntry {
string message_type = 1; // "summary" or "status"
double seconds_elapsed = 2;
int64 total_bytes = 3;
int64 bytes_restored = 4;
int64 total_files = 5;
int64 files_restored = 6;
double percent_done = 7; // 0.0 - 1.0
}
message RepoStats {
int64 total_size = 1;
int64 total_uncompressed_size = 2;
double compression_ratio = 3;
int64 total_blob_count = 5;
int64 snapshot_count = 6;
}