Sergiusz Bazanski | 4c0e9b5 | 2020-04-08 22:42:33 +0200 | [diff] [blame] | 1 | syntax = "proto3"; |
| 2 | package depotview; |
| 3 | option go_package = "code.hackerspace.pl/hscloud/devtools/depotview/proto"; |
| 4 | |
Sergiusz Bazanski | f157b4d | 2020-04-10 17:39:43 +0200 | [diff] [blame] | 5 | service 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 Bazanski | 4c0e9b5 | 2020-04-08 22:42:33 +0200 | [diff] [blame] | 17 | message ResolveRequest { |
| 18 | string ref = 1; |
| 19 | } |
| 20 | |
| 21 | message ResolveResponse { |
| 22 | string hash = 1; |
| 23 | int64 last_checked = 2; |
| 24 | } |
| 25 | |
Sergiusz Bazanski | f157b4d | 2020-04-10 17:39:43 +0200 | [diff] [blame] | 26 | message ResolveGerritChangeRequest { |
| 27 | int64 change = 1; |
| 28 | } |
| 29 | |
| 30 | message ResolveGerritChangeResponse { |
| 31 | string hash = 1; |
| 32 | int64 last_checked = 2; |
| 33 | } |
| 34 | |
Sergiusz Bazanski | 4c0e9b5 | 2020-04-08 22:42:33 +0200 | [diff] [blame] | 35 | message StatRequest { |
| 36 | string hash = 1; |
| 37 | string path = 2; |
| 38 | } |
| 39 | |
| 40 | message 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 | |
| 50 | message ReadRequest { |
| 51 | string hash = 1; |
| 52 | string path = 2; |
| 53 | } |
| 54 | |
| 55 | message ReadResponse { |
| 56 | // Chunk of data. Empty once everything has been sent over. |
| 57 | bytes data = 1; |
| 58 | } |