games/factorio: add modproxy

This adds a mod proxy system, called, well, modproxy.

It sits between Factorio server instances and the Factorio mod portal,
allowing for arbitrary mod download without needing the servers to know
Factorio credentials.

Change-Id: I7bc405a25b6f9559cae1f23295249f186761f212
diff --git a/games/factorio/modproxy/proto/modproxy.proto b/games/factorio/modproxy/proto/modproxy.proto
new file mode 100644
index 0000000..a4121b2
--- /dev/null
+++ b/games/factorio/modproxy/proto/modproxy.proto
@@ -0,0 +1,43 @@
+syntax = "proto3";
+package modproxy;
+option go_package = "code.hackerspace.pl/hscloud/games/factorio/modproxy/proto";
+
+service ModProxy {
+    rpc Mirror(MirrorRequest) returns (MirrorResponse);
+    rpc Download(DownloadRequest) returns (stream DownloadResponse);
+}
+
+message MirrorRequest {
+    // Authentication details to access the mod portal.
+    string username = 1;
+    string token = 2;
+}
+
+message MirrorResponse {
+    repeated string mods_okay = 1;
+    map<string, string> mods_errors = 2;
+}
+
+message DownloadRequest {
+    string mod_name = 1;
+    string file_sha1 = 2;
+}
+
+message DownloadResponse {
+    enum Status {
+        STATUS_INVALID = 0;
+        STATUS_OKAY = 1;
+        STATUS_NOT_AVAILABLE = 2;
+    };
+    Status status = 1;
+    bytes chunk = 2;
+}
+
+// Configuration for client (in text proto, so singular names in repeated fields)
+message ClientConfig {
+    message Mod {
+        string name = 1;
+        string version = 2;
+    }
+    repeated Mod mod = 1;
+}