feature: Adds working codegen.
This commit is contained in:
parent
594c2c4202
commit
ba53b7a25d
7 changed files with 142 additions and 2 deletions
126
data.capnp
Normal file
126
data.capnp
Normal file
|
@ -0,0 +1,126 @@
|
|||
@0x92a7c8962141ef12;
|
||||
|
||||
using Go = import "/go.capnp";
|
||||
$Go.package("commonbackend");
|
||||
$Go.import("git.terah.dev/imterah/hermes/backend/commonbackend");
|
||||
|
||||
enum Protocol {
|
||||
tcp @0;
|
||||
udp @1;
|
||||
}
|
||||
|
||||
enum StatusCode {
|
||||
success @0;
|
||||
failure @1;
|
||||
}
|
||||
|
||||
struct Start {
|
||||
id @0 :UInt8 = 0;
|
||||
arguments @1 :Data;
|
||||
}
|
||||
|
||||
struct Stop {
|
||||
id @0 :UInt8 = 1;
|
||||
}
|
||||
|
||||
struct AddProxy {
|
||||
id @0 :UInt8 = 2;
|
||||
sourceIP @1 :Data;
|
||||
sourcePort @2 :UInt16;
|
||||
destPort @3 :UInt16;
|
||||
protocol @4 :Protocol;
|
||||
}
|
||||
|
||||
struct RemoveProxy {
|
||||
id @0 :UInt8 = 3;
|
||||
sourceIP @1 :Data;
|
||||
sourcePort @2 :UInt16;
|
||||
destPort @3 :UInt16;
|
||||
protocol @4 :Protocol;
|
||||
}
|
||||
|
||||
struct ProxyStatusRequest {
|
||||
id @0 :UInt8 = 4;
|
||||
sourceIP @1 :Data;
|
||||
sourcePort @2 :UInt16;
|
||||
destPort @3 :UInt16;
|
||||
protocol @4 :Protocol;
|
||||
}
|
||||
|
||||
struct ProxyStatusResponse {
|
||||
id @0 :UInt8 = 5;
|
||||
sourceIP @1 :Data;
|
||||
sourcePort @2 :UInt16;
|
||||
destPort @3 :UInt16;
|
||||
protocol @4 :Protocol;
|
||||
isActive @5 :Bool;
|
||||
}
|
||||
|
||||
struct ProxyInstanceRequest {
|
||||
id @0 :UInt8 = 6;
|
||||
}
|
||||
|
||||
struct ProxyInstanceResponse {
|
||||
id @0 :UInt8 = 7;
|
||||
proxies @1 :List(ProxyInstance);
|
||||
|
||||
struct ProxyInstance {
|
||||
sourceIP @0 :Text;
|
||||
sourcePort @1 :UInt16;
|
||||
destPort @2 :UInt16;
|
||||
protocol @3 :Protocol;
|
||||
}
|
||||
}
|
||||
|
||||
struct BackendStatusRequest {
|
||||
id @0 :UInt8 = 8;
|
||||
}
|
||||
|
||||
struct BackendStatusResponse {
|
||||
id @0 :UInt8 = 9;
|
||||
isRunning @1 :Bool;
|
||||
statusCode @2 :StatusCode;
|
||||
message @3 :Text;
|
||||
}
|
||||
|
||||
struct ProxyConnectionsRequest {
|
||||
id @0 :UInt8 = 10;
|
||||
}
|
||||
|
||||
struct ProxyConnectionsResponse {
|
||||
id @0 :UInt8 = 11;
|
||||
connections @1 :List(Connection);
|
||||
|
||||
struct Connection {
|
||||
sourceIP @0 :Data;
|
||||
sourcePort @1 :UInt16;
|
||||
destPort @2 :UInt16;
|
||||
clientIP @3 :Data;
|
||||
clientPort @4 :UInt16;
|
||||
}
|
||||
}
|
||||
|
||||
struct CheckClientParameters {
|
||||
id @0 :UInt8 = 12;
|
||||
sourceIP @1 :Data;
|
||||
sourcePort @2 :UInt16;
|
||||
destPort @3 :UInt16;
|
||||
protocol @4 :Protocol;
|
||||
}
|
||||
|
||||
struct CheckServerParameters {
|
||||
id @0 :UInt8 = 13;
|
||||
arguments @1 :Data;
|
||||
}
|
||||
|
||||
struct CheckParametersResponse {
|
||||
id @0 :UInt8 = 14;
|
||||
inResponseTo @1 :InResponseTo;
|
||||
isValid @2 :Bool;
|
||||
message @3 :Text;
|
||||
|
||||
enum InResponseTo {
|
||||
checkClientParameters @0;
|
||||
checkServerParameters @1;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue