-
Notifications
You must be signed in to change notification settings - Fork 1
/
web.proto
69 lines (55 loc) · 1.49 KB
/
web.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
syntax = "proto3";
package web;
//import "github.com/johanbrandhorst/protobuf/proto/gopherjs.proto";
// Define the package locations the generated files will go into
//option (gopherjs.gopherjs_package) = "github.com/anxiousmodernman/co-chair/proto/client";
option go_package = "github.com/anxiousmodernman/co-chair/proto/server";
service Proxy {
rpc State(StateRequest) returns (ProxyState) {}
rpc Put(Backend) returns (OpResult) {}
rpc Remove(Backend) returns (OpResult) {}
rpc PutKVStream(stream KV) returns (OpResult) {}
rpc GetKVStream(Key) returns (stream KV) {}
}
message Backend {
string domain = 1;
repeated string ips = 2;
string health_check = 3;
string health_status = 4;
enum Protocol {
HTTP1 = 0;
HTTP2 = 1;
GRPC = 3;
};
Protocol protocol = 5;
X509Cert internet_cert = 6;
X509Cert backend_cert = 7;
map<string, string> match_headers = 8;
}
message X509Cert {
bytes cert = 1;
bytes key = 2;
}
message Key {
bytes prefix = 1;
}
message KV {
bytes key = 1;
bytes value = 2;
}
message ProxyState {
repeated Backend backends = 1;
// a status message, or an error message.
string status = 2;
// an error code
int32 code = 3;
}
message OpResult {
int32 code = 1;
string status = 2;
}
message StateRequest {
// if domain is empty string, return "all" states, otherwise
// match domain DNS-style, e.g. google.com matches docs.google.com
string domain = 1;
}