| syntax = "proto3"; |
| package depotview; |
| option go_package = "code.hackerspace.pl/hscloud/devtools/depotview/proto"; |
| |
| service DepotView { |
| // Resolve a git branch/tag/ref... into a commit hash. |
| rpc Resolve(ResolveRequest) returns (ResolveResponse); |
| |
| // Resolve a gerrit change number into a git commit hash. |
| rpc ResolveGerritChange(ResolveGerritChangeRequest) returns (ResolveGerritChangeResponse); |
| |
| // Minimal file access API. It kinda stinks. |
| rpc Stat(StatRequest) returns (StatResponse); |
| rpc Read(ReadRequest) returns (stream ReadResponse); |
| } |
| |
| message ResolveRequest { |
| string ref = 1; |
| } |
| |
| message ResolveResponse { |
| string hash = 1; |
| int64 last_checked = 2; |
| } |
| |
| message ResolveGerritChangeRequest { |
| int64 change = 1; |
| } |
| |
| message ResolveGerritChangeResponse { |
| string hash = 1; |
| int64 last_checked = 2; |
| } |
| |
| message StatRequest { |
| string hash = 1; |
| string path = 2; |
| } |
| |
| message StatResponse { |
| enum Type { |
| TYPE_INVALID = 0; |
| TYPE_NOT_PRESENT = 1; |
| TYPE_FILE = 2; |
| TYPE_DIRECTORY = 3; |
| }; |
| Type type = 1; |
| } |
| |
| message ReadRequest { |
| string hash = 1; |
| string path = 2; |
| } |
| |
| message ReadResponse { |
| // Chunk of data. Empty once everything has been sent over. |
| bytes data = 1; |
| } |