1syntax = "proto3";
2
3package synchronization;
4
5option go_package = "github.com/mutagen-io/mutagen/pkg/service/synchronization";
6
7import "selection/selection.proto";
8import "synchronization/configuration.proto";
9import "synchronization/state.proto";
10import "url/url.proto";
11
12message CreationSpecification {
13    // Alpha is the alpha endpoint URL for the session.
14    url.URL alpha = 1;
15    // Beta is the beta endpoint URL for the session.
16    url.URL beta = 2;
17    // Configuration is the base session configuration. It is the result of
18    // merging the global configuration (unless disabled), any manually
19    // specified configuration file, and any command line configuration
20    // parameters.
21    synchronization.Configuration configuration = 3;
22    // ConfigurationAlpha is the alpha-specific session configuration. It is
23    // determined based on command line configuration parameters.
24    synchronization.Configuration configurationAlpha = 4;
25    // ConfigurationBeta is the beta-specific session configuration. It is
26    // determined based on command line configuration parameters.
27    synchronization.Configuration configurationBeta = 5;
28    // Name is the name for the session object.
29    string name = 6;
30    // Labels are the labels for the session object.
31    map<string, string> labels = 7;
32    // Paused indicates whether or not to create the session pre-paused.
33    bool paused = 8;
34}
35
36message CreateRequest {
37    CreationSpecification specification = 1;
38    string response = 2;
39}
40
41message CreateResponse {
42    string session = 1;
43    string message = 2;
44    string prompt = 3;
45}
46
47message ListRequest {
48    selection.Selection selection = 1;
49    uint64 previousStateIndex = 2;
50}
51
52message ListResponse {
53    uint64 stateIndex = 1;
54    repeated synchronization.State sessionStates = 2;
55}
56
57message FlushRequest {
58    selection.Selection selection = 1;
59    bool skipWait = 2;
60}
61
62message FlushResponse {
63    string message = 1;
64}
65
66message PauseRequest {
67    selection.Selection selection = 1;
68}
69
70message PauseResponse {
71    string message = 1;
72}
73
74message ResumeRequest {
75    selection.Selection selection = 1;
76    string response = 2;
77}
78
79message ResumeResponse {
80    string message = 1;
81    string prompt = 2;
82}
83
84message ResetRequest {
85    selection.Selection selection = 1;
86    string response = 2;
87}
88
89message ResetResponse {
90    string message = 1;
91    string prompt = 2;
92}
93
94message TerminateRequest {
95    selection.Selection selection = 1;
96}
97
98message TerminateResponse {
99    string message = 1;
100}
101
102service Synchronization {
103    rpc Create(stream CreateRequest) returns (stream CreateResponse) {}
104    rpc List(ListRequest) returns (ListResponse) {}
105    rpc Flush(stream FlushRequest) returns (stream FlushResponse) {}
106    rpc Pause(stream PauseRequest) returns (stream PauseResponse) {}
107    rpc Resume(stream ResumeRequest) returns (stream ResumeResponse) {}
108    rpc Reset(stream ResetRequest) returns (stream ResetResponse) {}
109    rpc Terminate(stream TerminateRequest) returns (stream TerminateResponse) {}
110}
111