github.com/mutagen-io/mutagen@v0.18.0-rc1/pkg/synchronization/endpoint/remote/protocol.proto (about) 1 syntax = "proto3"; 2 3 package remote; 4 5 option go_package = "github.com/mutagen-io/mutagen/pkg/synchronization/endpoint/remote"; 6 7 import "synchronization/rsync/engine.proto"; 8 import "synchronization/configuration.proto"; 9 import "synchronization/version.proto"; 10 import "synchronization/core/archive.proto"; 11 import "synchronization/core/change.proto"; 12 import "synchronization/core/problem.proto"; 13 14 // InitializeSynchronizationRequest encodes a request for endpoint 15 // initialization. 16 message InitializeSynchronizationRequest { 17 // Session is the session identifier. 18 string session = 1; 19 // Version is the session version. 20 synchronization.Version version = 2; 21 // Configuration is the session configuration. 22 synchronization.Configuration configuration = 3; 23 // Root is the synchronization root path. 24 string root = 4; 25 // Alpha indicates whether or not the endpoint should behave as alpha (as 26 // opposed to beta). 27 bool alpha = 5; 28 } 29 30 // InitializeSynchronizationResponse encodes initialization results. 31 message InitializeSynchronizationResponse { 32 // Error is the error message (if any) resulting from initialization. 33 string error = 1; 34 } 35 36 // PollRequest encodes a request for one-shot polling. 37 message PollRequest {} 38 39 // PollCompletionRequest is paired with PollRequest and indicates a request for 40 // early polling completion or an acknowledgement of completion. 41 message PollCompletionRequest{} 42 43 // PollResponse indicates polling completion. 44 message PollResponse { 45 // Error is the error message (if any) resulting from polling. 46 string error = 1; 47 } 48 49 // ScanRequest encodes a request for a scan. 50 message ScanRequest { 51 // BaselineSnapshotSignature is the rsync signature to use as the base for 52 // differentially transmitting snapshots. 53 rsync.Signature baselineSnapshotSignature = 1; 54 // Full indicates whether or not to force a full (warm) scan, temporarily 55 // avoiding any acceleration that might be available on the endpoint. 56 bool full = 2; 57 } 58 59 // ScanCompletionRequest is paired with a ScanRequest and indicates a request 60 // for scan cancellation or an acknowledgement of completion. 61 message ScanCompletionRequest{} 62 63 // ScanResponse encodes the results of a scan. 64 message ScanResponse { 65 // SnapshotDelta are the operations need to reconstruct the snapshot against 66 // the specified base. 67 repeated rsync.Operation snapshotDelta = 1; 68 // Error is the error message (if any) resulting from scanning. 69 string error = 2; 70 // TryAgain indicates whether or not the error is ephermeral. 71 bool tryAgain = 3; 72 } 73 74 // StageRequest encodes a request for staging. 75 message StageRequest { 76 // Paths lists the paths that need to be staged. 77 repeated string paths = 1; 78 // Digests lists the digests for the paths that need to be staged. Its 79 // length and contents correspond to that of Paths. 80 repeated bytes digests = 2; 81 } 82 83 // StageResponse encodes the results of staging initialization. 84 message StageResponse { 85 // Paths are the paths that need to be staged after filtering. If its length 86 // is zero and the length of Signatures is non-zero, then it's assumed that 87 // all paths are required and (in that scenario) the length of Signatures 88 // must be equal to the length of the original path list. 89 repeated string paths = 1; 90 // Signatures are the rsync signatures of the paths needing to be staged. 91 repeated rsync.Signature signatures = 2; 92 // Error is the error message (if any) resulting from staging 93 // initialization. 94 string error = 3; 95 } 96 97 // SupplyRequest indicates a request for supplying files. 98 message SupplyRequest { 99 // Paths are the paths to provide (relative to the synchronization root). 100 repeated string paths = 1; 101 // Signatures are the rsync signatures of the paths needing to be staged. 102 repeated rsync.Signature signatures = 2; 103 } 104 105 // TransitionRequest encodes a request for transition application. 106 message TransitionRequest { 107 // Transitions are the transitions that need to be applied. 108 repeated core.Change transitions = 1; 109 } 110 111 // TransitionCompletionRequest is paired with a TransitionRequest and indicates 112 // a request for transition cancellation or an acknowledgement of completion. 113 message TransitionCompletionRequest{} 114 115 // TransitionResponse encodes the results of transitioning. 116 message TransitionResponse { 117 // Results are the resulting contents post-transition. 118 // HACK: We have to use Archive to wrap our Entry results here because 119 // Protocol Buffers won't encode a nil pointer in a repeated element in 120 // certain cases, and the results of transitions may very well be nil. gob 121 // also exhibits this problem. 122 repeated core.Archive results = 1; 123 // Problems are any problems encountered during the transition operation. 124 repeated core.Problem problems = 2; 125 // StagerMissingFiles indicates whether or not the endpoint's stager 126 // indicated missing files during transitioning. 127 bool stagerMissingFiles = 3; 128 // Error is the error message (if any) resulting from the remote transition 129 // method. This will always be an empty string since transition doesn't 130 // return errors from local endpoints, but to match the endpoint interface 131 // (which allows for transition errors due to network failures with remote 132 // endpoints), we include this field. 133 // TODO: Should we just remove this field? Doing so would rely on knowledge 134 // of localEndpoint's transition behavior. 135 string error = 4; 136 } 137 138 // EndpointRequest is a sum type that can transmit any type of endpoint request. 139 // Only the sent request will be non-nil. We intentionally avoid using Protocol 140 // Buffers' oneof feature because it generates really ugly code and an unwieldy 141 // API, at least in Go. Manually checking for exclusivity is not difficult. 142 message EndpointRequest { 143 // Poll represents a poll request. 144 PollRequest poll = 1; 145 // Scan represents a scan request. 146 ScanRequest scan = 2; 147 // Stage represents a stage request. 148 StageRequest stage = 3; 149 // Supply represents a supply request. 150 SupplyRequest supply = 4; 151 // Transition represents a transition request. 152 TransitionRequest transition = 5; 153 }