1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172
|
syntax = "proto3";
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";
option go_package = "./rpc";
service CLI {
rpc GetVersion (google.protobuf.Empty) returns (VersionReply) {}
rpc Upgrade (google.protobuf.Empty) returns (google.protobuf.Empty) {}
rpc Reload (google.protobuf.Empty) returns (google.protobuf.Empty) {}
rpc ChangeStatus (ChangeStatusRequest) returns (google.protobuf.Empty) {}
rpc List (google.protobuf.Empty) returns (MirrorListReply) {}
rpc MirrorInfo (MirrorIDRequest) returns (Mirror) {}
rpc AddMirror (Mirror) returns (AddMirrorReply) {}
rpc UpdateMirror (Mirror) returns (UpdateMirrorReply) {}
rpc RemoveMirror (MirrorIDRequest) returns (google.protobuf.Empty) {}
rpc GeoUpdateMirror (MirrorIDRequest) returns (GeoUpdateMirrorReply) {}
rpc RefreshRepository (RefreshRepositoryRequest) returns (google.protobuf.Empty) {}
rpc ScanMirror (ScanMirrorRequest) returns (ScanMirrorReply) {}
rpc StatsFile (StatsFileRequest) returns (StatsFileReply) {}
rpc StatsMirror (StatsMirrorRequest) returns (StatsMirrorReply) {}
rpc Ping (google.protobuf.Empty) returns (google.protobuf.Empty) {}
rpc GetMirrorLogs (GetMirrorLogsRequest) returns (GetMirrorLogsReply) {}
// Tools
rpc MatchMirror (MatchRequest) returns (MatchReply) {}
}
message VersionReply {
string Version = 1;
string Build = 2;
string GoVersion = 3;
string OS = 4;
string Arch = 5;
int32 GoMaxProcs = 6;
}
message MatchRequest {
string Pattern = 1;
}
message Mirror {
int32 ID = 1;
string Name = 2;
string HttpURL = 3;
string RsyncURL = 4;
string FtpURL = 5;
string SponsorName = 6;
string SponsorURL = 7;
string SponsorLogoURL = 8;
string AdminName = 9;
string AdminEmail = 10;
string CustomData = 11;
bool ContinentOnly = 12;
bool CountryOnly = 13;
bool ASOnly = 14;
int32 Score = 15;
float Latitude = 16;
float Longitude = 17;
string ContinentCode = 18;
string CountryCodes = 19;
string ExcludedCountryCodes = 20;
uint32 Asnum = 21;
string Comment = 22;
bool Enabled = 23;
bool HttpUp = 24;
string HttpDownReason = 25;
google.protobuf.Timestamp StateSince = 26;
int32 AllowRedirects = 27;
google.protobuf.Timestamp LastSync = 28;
google.protobuf.Timestamp LastSuccessfulSync = 29;
google.protobuf.Timestamp LastModTime = 30;
bool HttpsUp = 31;
string HttpsDownReason = 32;
}
message MirrorListReply {
repeated Mirror Mirrors = 1;
}
message MirrorID {
int32 ID = 1;
string Name = 2;
}
message MatchReply {
repeated MirrorID Mirrors = 1;
}
message ChangeStatusRequest {
int32 ID = 1;
bool Enabled = 2;
}
message MirrorIDRequest {
int32 ID = 1;
}
message AddMirrorReply {
float Latitude = 1;
float Longitude = 2;
string Country = 3;
string Continent = 4;
string ASN = 5;
repeated string Warnings = 6;
}
message UpdateMirrorReply {
string Diff = 1;
}
message GeoUpdateMirrorReply {
Mirror Mirror = 1;
string Diff = 2;
repeated string Warnings = 3;
}
message RefreshRepositoryRequest {
bool Rehash = 1;
}
message ScanMirrorRequest {
int32 ID = 1;
bool AutoEnable = 2;
enum Method {
ALL = 0;
FTP = 1;
RSYNC = 2;
}
Method Protocol = 3;
}
message ScanMirrorReply {
bool Enabled = 1;
int64 FilesIndexed = 2;
int64 KnownIndexed = 3;
int64 Removed = 4;
int64 TZOffsetMs = 5;
}
message StatsFileRequest {
string Pattern = 1;
google.protobuf.Timestamp DateStart = 2;
google.protobuf.Timestamp DateEnd = 3;
}
message StatsFileReply {
map<string, int64> files = 1;
}
message StatsMirrorRequest {
int32 ID = 1;
google.protobuf.Timestamp DateStart = 2;
google.protobuf.Timestamp DateEnd = 3;
}
message StatsMirrorReply {
Mirror Mirror = 1;
int64 Requests = 2;
int64 Bytes = 3;
}
message GetMirrorLogsRequest {
int32 ID = 1;
int32 MaxResults = 2;
}
message GetMirrorLogsReply {
repeated string line = 1;
}
|