-
Notifications
You must be signed in to change notification settings - Fork 159
/
Copy pathstate.proto
132 lines (126 loc) · 6.25 KB
/
state.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
syntax = "proto3";
package synchronization;
option go_package = "github.com/mutagen-io/mutagen/pkg/synchronization";
import "synchronization/rsync/receive.proto";
import "synchronization/session.proto";
import "synchronization/core/conflict.proto";
import "synchronization/core/problem.proto";
// Status encodes the status of a synchronization session.
enum Status {
// Status_Disconnected indicates that the session is unpaused but not
// currently connected or connecting to either endpoint.
Disconnected = 0;
// Status_HaltedOnRootEmptied indicates that the session is halted due to
// the root emptying safety check.
HaltedOnRootEmptied = 1;
// Status_HaltedOnRootDeletion indicates that the session is halted due to
// the root deletion safety check.
HaltedOnRootDeletion = 2;
// Status_HaltedOnRootTypeChange indicates that the session is halted due to
// the root type change safety check.
HaltedOnRootTypeChange = 3;
// Status_ConnectingAlpha indicates that the session is attempting to
// connect to the alpha endpoint.
ConnectingAlpha = 4;
// Status_ConnectingBeta indicates that the session is attempting to connect
// to the beta endpoint.
ConnectingBeta = 5;
// Status_Watching indicates that the session is watching for filesystem
// changes.
Watching = 6;
// Status_Scanning indicates that the session is scanning the filesystem on
// each endpoint.
Scanning = 7;
// Status_WaitingForRescan indicates that the session is waiting to retry
// scanning after an error during the previous scanning operation.
WaitingForRescan = 8;
// Status_Reconciling indicates that the session is performing
// reconciliation.
Reconciling = 9;
// Status_StagingAlpha indicates that the session is staging files on alpha.
StagingAlpha = 10;
// Status_StagingBeta indicates that the session is staging files on beta.
StagingBeta = 11;
// Status_Transitioning indicates that the session is performing transition
// operations on each endpoint.
Transitioning = 12;
// Status_Saving indicates that the session is recording synchronization
// history to disk.
Saving = 13;
}
// EndpointState encodes the current state of a synchronization endpoint. It is
// mutable within the context of the daemon, so it should be accessed and
// modified in a synchronized fashion. Outside of the daemon (e.g. when returned
// via the API), it should be considered immutable.
message EndpointState {
// Connected indicates whether or not the controller is currently connected
// to the endpoint.
bool connected = 1;
// Scanned indicates whether or not at least one scan has been performed on
// the endpoint.
bool scanned = 2;
// Directories is the number of synchronizable directory entries contained
// in the last snapshot from the endpoint.
uint64 directories = 3;
// Files is the number of synchronizable file entries contained in the last
// snapshot from the endpoint.
uint64 files = 4;
// SymbolicLinks is the number of synchronizable symbolic link entries
// contained in the last snapshot from the endpoint.
uint64 symbolicLinks = 5;
// TotalFileSize is the total size of all synchronizable files referenced by
// the last snapshot from the endpoint.
uint64 totalFileSize = 6;
// ScanProblems is the list of non-terminal problems encountered during the
// last scanning operation on the endpoint. This list may be a truncated
// version of the full list if too many problems are encountered to report
// via the API, in which case ExcludedScanProblems will be non-zero.
repeated core.Problem scanProblems = 7;
// ExcludedScanProblems is the number of problems that have been excluded
// from ScanProblems due to truncation. This value can be non-zero only if
// ScanProblems is non-empty.
uint64 excludedScanProblems = 8;
// TransitionProblems is the list of non-terminal problems encountered
// during the last transition operation on the endpoint. This list may be a
// truncated version of the full list if too many problems are encountered
// to report via the API, in which case ExcludedTransitionProblems will be
// non-zero.
repeated core.Problem transitionProblems = 9;
// ExcludedTransitionProblems is the number of problems that have been
// excluded from TransitionProblems due to truncation. This value can be
// non-zero only if TransitionProblems is non-empty.
uint64 excludedTransitionProblems = 10;
// StagingProgress is the rsync staging progress. It is non-nil if and only
// if the endpoint is currently staging files.
rsync.ReceiverState stagingProgress = 11;
}
// State encodes the current state of a synchronization session. It is mutable
// within the context of the daemon, so it should be accessed and modified in a
// synchronized fashion. Outside of the daemon (e.g. when returned via the API),
// it should be considered immutable.
message State {
// Session is the session metadata. If the session is paused, then the
// remainder of the fields in this structure should be ignored.
Session session = 1;
// Status is the session status.
Status status = 2;
// LastError is the last error to occur during synchronization. It is
// cleared after a successful synchronization cycle.
string lastError = 3;
// SuccessfulCycles is the number of successful synchronization cycles to
// occur since successfully connecting to the endpoints.
uint64 successfulCycles = 4;
// Conflicts are the content conflicts identified during reconciliation.
// This list may be a truncated version of the full list if too many
// conflicts are encountered to report via the API, in which case
// ExcludedConflicts will be non-zero.
repeated core.Conflict conflicts = 5;
// ExcludedConflicts is the number of conflicts that have been excluded from
// Conflicts due to truncation. This value can be non-zero only if conflicts
// is non-empty.
uint64 excludedConflicts = 6;
// AlphaState encodes the state of the alpha endpoint. It is always non-nil.
EndpointState alphaState = 7;
// BetaState encodes the state of the beta endpoint. It is always non-nil.
EndpointState betaState = 8;
}