forked from mozilla/sccache
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprotocol.proto
101 lines (87 loc) · 2.42 KB
/
protocol.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
// Copyright 2016 Mozilla Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package sccache;
// Get cache statistics.
message GetStats {}
// Shut down the server.
message Shutdown {}
// Zero cache statistics.
message ZeroStats {}
// Run a compile command.
message Compile {
// The directory in which to run the command.
required string cwd = 1;
// The executable to run.
required string exe = 2;
// The command line arguments.
repeated string command = 3;
}
message ClientRequest {
// A client request can be any one of the following:
oneof request {
Compile compile = 1;
GetStats get_stats = 2;
Shutdown shutdown = 3;
ZeroStats zero_stats = 4;
}
}
// A single cache statistic.
message CacheStatistic {
required string name = 1;
oneof value {
// A simple counter.
uint64 count = 2;
// A string value.
string str = 3;
// A size, in bytes.
uint64 size = 4;
}
}
// A list of cache statistics.
message CacheStats {
repeated CacheStatistic stats = 1;
}
// The server is shutting down.
message ShuttingDown {
required CacheStats stats = 1;
}
// The server started executing a compilation.
message CompileStarted {}
// The server ran a compile command.
message CompileFinished {
// The return code of the process.
oneof exit_status {
// Normal exit.
int32 retcode = 1;
// Terminated by a signal.
int32 signal = 2;
}
optional bytes stdout = 3;
optional bytes stderr = 4;
}
// The server could not handle this compile command line.
message UnhandledCompile {}
// This command was unknown to the server.
message UnknownCommand {}
message ServerResponse {
// A server response can be any one of the following:
oneof response {
CacheStats stats = 1;
ShuttingDown shutting_down = 2;
CompileStarted compile_started = 3;
CompileFinished compile_finished = 4;
UnhandledCompile unhandled_compile = 5;
UnknownCommand unknown = 6;
}
}