mirror of
https://github.com/MatsuriDayo/nekoray.git
synced 2025-12-17 20:44:38 +03:00
90 lines
1.5 KiB
Protocol Buffer
90 lines
1.5 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package libcore;
|
|
option go_package = "neko/gen";
|
|
|
|
service LibcoreService {
|
|
rpc Exit(EmptyReq) returns (EmptyResp) {}
|
|
rpc Update(UpdateReq) returns (UpdateResp) {}
|
|
//
|
|
rpc Start(LoadConfigReq) returns (ErrorResp) {}
|
|
rpc Stop(EmptyReq) returns (ErrorResp) {}
|
|
rpc Test(TestReq) returns (TestResp) {}
|
|
rpc QueryStats(QueryStatsReq) returns (QueryStatsResp) {}
|
|
rpc ListConnections(EmptyReq) returns (ListConnectionsResp) {}
|
|
}
|
|
|
|
message EmptyReq {}
|
|
|
|
message EmptyResp {}
|
|
|
|
message ErrorResp {
|
|
string error = 1;
|
|
}
|
|
|
|
message LoadConfigReq {
|
|
string coreConfig = 1;
|
|
string tryDomains = 2;
|
|
}
|
|
|
|
enum TestMode {
|
|
TcpPing = 0;
|
|
UrlTest = 1;
|
|
FullTest = 2;
|
|
}
|
|
|
|
message TestReq {
|
|
TestMode mode = 1;
|
|
int32 timeout = 6;
|
|
// TcpPing
|
|
string address = 2;
|
|
// UrlTest
|
|
LoadConfigReq config = 3;
|
|
string inbound = 4;
|
|
string url = 5;
|
|
// FullTest
|
|
string in_address = 7;
|
|
bool full_latency = 8;
|
|
bool full_speed = 9;
|
|
bool full_in_out = 10;
|
|
bool full_nat = 11;
|
|
}
|
|
|
|
message TestResp {
|
|
string error = 1;
|
|
int32 ms = 2;
|
|
string full_report = 3;
|
|
}
|
|
|
|
message QueryStatsReq{
|
|
string tag = 1;
|
|
string direct = 2;
|
|
}
|
|
|
|
message QueryStatsResp{
|
|
int64 traffic = 1;
|
|
}
|
|
|
|
enum UpdateAction {
|
|
Check = 0;
|
|
Download = 1;
|
|
}
|
|
|
|
message UpdateReq {
|
|
UpdateAction action = 1;
|
|
bool check_pre_release = 2;
|
|
}
|
|
|
|
message UpdateResp {
|
|
string error = 1;
|
|
string assets_name = 2;
|
|
string download_url = 3;
|
|
string release_url = 4;
|
|
string release_note = 5;
|
|
bool is_pre_release = 6;
|
|
}
|
|
|
|
message ListConnectionsResp {
|
|
string matsuri_connections_json = 1;
|
|
}
|