Sergiusz Bazanski | 0581bbf | 2020-05-11 03:21:32 +0200 | [diff] [blame] | 1 | syntax = "proto3"; |
| 2 | package modproxy; |
| 3 | option go_package = "code.hackerspace.pl/hscloud/games/factorio/modproxy/proto"; |
| 4 | |
| 5 | service ModProxy { |
| 6 | rpc Mirror(MirrorRequest) returns (MirrorResponse); |
| 7 | rpc Download(DownloadRequest) returns (stream DownloadResponse); |
| 8 | } |
| 9 | |
| 10 | message MirrorRequest { |
| 11 | // Authentication details to access the mod portal. |
| 12 | string username = 1; |
| 13 | string token = 2; |
| 14 | } |
| 15 | |
| 16 | message MirrorResponse { |
| 17 | repeated string mods_okay = 1; |
| 18 | map<string, string> mods_errors = 2; |
| 19 | } |
| 20 | |
| 21 | message DownloadRequest { |
| 22 | string mod_name = 1; |
| 23 | string file_sha1 = 2; |
| 24 | } |
| 25 | |
| 26 | message DownloadResponse { |
| 27 | enum Status { |
| 28 | STATUS_INVALID = 0; |
| 29 | STATUS_OKAY = 1; |
| 30 | STATUS_NOT_AVAILABLE = 2; |
| 31 | }; |
| 32 | Status status = 1; |
| 33 | bytes chunk = 2; |
| 34 | } |
| 35 | |
| 36 | // Configuration for client (in text proto, so singular names in repeated fields) |
| 37 | message ClientConfig { |
| 38 | message Mod { |
| 39 | string name = 1; |
| 40 | string version = 2; |
| 41 | } |
| 42 | repeated Mod mod = 1; |
| 43 | } |