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 | |
| 5 | message ResolveRequest { |
| 6 | string ref = 1; |
| 7 | } |
| 8 | |
| 9 | message ResolveResponse { |
| 10 | string hash = 1; |
| 11 | int64 last_checked = 2; |
| 12 | } |
| 13 | |
| 14 | message StatRequest { |
| 15 | string hash = 1; |
| 16 | string path = 2; |
| 17 | } |
| 18 | |
| 19 | message 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 | |
| 29 | message ReadRequest { |
| 30 | string hash = 1; |
| 31 | string path = 2; |
| 32 | } |
| 33 | |
| 34 | message ReadResponse { |
| 35 | // Chunk of data. Empty once everything has been sent over. |
| 36 | bytes data = 1; |
| 37 | } |
| 38 | |
| 39 | service 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 | } |