blob: 2584961534d5e2e36c805310e0210e09939233a5 [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
5message ResolveRequest {
6 string ref = 1;
7}
8
9message ResolveResponse {
10 string hash = 1;
11 int64 last_checked = 2;
12}
13
14message StatRequest {
15 string hash = 1;
16 string path = 2;
17}
18
19message StatResponse {
20 enum Type {
21 TYPE_INVALID = 0;
22 TYPE_NOT_PRESENT = 1;
23 TYPE_FILE = 2;
24 TYPE_DIRECTORY = 3;
25 };
26 Type type = 1;
27}
28
29message ReadRequest {
30 string hash = 1;
31 string path = 2;
32}
33
34message ReadResponse {
35 // Chunk of data. Empty once everything has been sent over.
36 bytes data = 1;
37}
38
39service DepotView {
40 // Resolve a git branch/tag/ref... into a commit hash.
41 rpc Resolve(ResolveRequest) returns (ResolveResponse);
42
43 // Minimal file access API. It kinda stinks.
44 rpc Stat(StatRequest) returns (StatResponse);
45 rpc Read(ReadRequest) returns (stream ReadResponse);
46}