blob: b948faedaec3baabb59d58bb5e027e75c9130617 [file] [log] [blame]
Sergiusz Bazanski4c0e9b52020-04-08 22:42:33 +02001syntax = "proto3";
2package depotview;
3option go_package = "code.hackerspace.pl/hscloud/devtools/depotview/proto";
4
Sergiusz Bazanskif157b4d2020-04-10 17:39:43 +02005service DepotView {
6 // Resolve a git branch/tag/ref... into a commit hash.
7 rpc Resolve(ResolveRequest) returns (ResolveResponse);
8
9 // Resolve a gerrit change number into a git commit hash.
10 rpc ResolveGerritChange(ResolveGerritChangeRequest) returns (ResolveGerritChangeResponse);
11
12 // Minimal file access API. It kinda stinks.
13 rpc Stat(StatRequest) returns (StatResponse);
14 rpc Read(ReadRequest) returns (stream ReadResponse);
15}
16
Sergiusz Bazanski4c0e9b52020-04-08 22:42:33 +020017message ResolveRequest {
18 string ref = 1;
19}
20
21message ResolveResponse {
22 string hash = 1;
23 int64 last_checked = 2;
24}
25
Sergiusz Bazanskif157b4d2020-04-10 17:39:43 +020026message ResolveGerritChangeRequest {
27 int64 change = 1;
28}
29
30message ResolveGerritChangeResponse {
31 string hash = 1;
32 int64 last_checked = 2;
33}
34
Sergiusz Bazanski4c0e9b52020-04-08 22:42:33 +020035message StatRequest {
36 string hash = 1;
37 string path = 2;
38}
39
40message StatResponse {
41 enum Type {
42 TYPE_INVALID = 0;
43 TYPE_NOT_PRESENT = 1;
44 TYPE_FILE = 2;
45 TYPE_DIRECTORY = 3;
46 };
47 Type type = 1;
48}
49
50message ReadRequest {
51 string hash = 1;
52 string path = 2;
53}
54
55message ReadResponse {
56 // Chunk of data. Empty once everything has been sent over.
57 bytes data = 1;
58}