.editorconfig, format

This commit is contained in:
2023-03-22 16:56:24 +01:00
parent 99cb5928bc
commit 7870b454f8
5 changed files with 44 additions and 35 deletions
+9
View File
@@ -0,0 +1,9 @@
root = true
[*.proto]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
+4 -4
View File
@@ -4,7 +4,7 @@ syntax = "proto3";
// Request logging into the server // Request logging into the server
// seed: the seed used to generate the address // seed: the seed used to generate the address
message AuthenticationRequest { message AuthenticationRequest {
fixed64 seed = 1; fixed64 seed = 1;
} }
// Server -> Client // Server -> Client
@@ -12,6 +12,6 @@ message AuthenticationRequest {
// status: 0 if successful, anything else is an error // status: 0 if successful, anything else is an error
// address: the address assigned to the peer // address: the address assigned to the peer
message AuthenticationResponse { message AuthenticationResponse {
uint32 status = 1; uint32 status = 1;
fixed64 address = 2; fixed64 address = 2;
} }
+13 -13
View File
@@ -2,17 +2,17 @@ syntax = "proto3";
// Client <-> Server // Client <-> Server
message Container { message Container {
enum MessageType { enum MessageType {
AuthenticationRequest = 0; AuthenticationRequest = 0;
AuthenticationResponse = 1; AuthenticationResponse = 1;
Message = 2; Message = 2;
PublishRequest = 3; PublishRequest = 3;
PublishResponse = 4; PublishResponse = 4;
DiscoverRequest = 5; DiscoverRequest = 5;
DiscoverResponse = 6; DiscoverResponse = 6;
} }
MessageType type = 1; MessageType type = 1;
uint32 id = 2; uint32 id = 2;
bytes data = 3; bytes data = 3;
} }
+5 -5
View File
@@ -2,11 +2,11 @@ syntax = "proto3";
// Client <-> Server // Client <-> Server
// address: // address:
// Client -> Server: destination // Client -> Server: destination
// Server -> Client: source // Server -> Client: source
// data: message data // data: message data
message Message { message Message {
fixed64 address = 1; fixed64 address = 1;
fixed32 port = 2; fixed32 port = 2;
bytes data = 3; bytes data = 3;
} }
+13 -13
View File
@@ -8,16 +8,16 @@ syntax = "proto3";
// false: delete the port // false: delete the port
// flags: search flags // flags: search flags
message PublishRequest { message PublishRequest {
fixed32 port = 1; fixed32 port = 1;
bool publish = 2; bool publish = 2;
repeated string flags = 3; repeated string flags = 3;
} }
// Server -> Client // Server -> Client
// Acknowledge a PublishRequest // Acknowledge a PublishRequest
// status: 0 if successful, anything else is an error // status: 0 if successful, anything else is an error
message PublishResponse { message PublishResponse {
uint32 status = 1; uint32 status = 1;
} }
// Client -> Server // Client -> Server
@@ -25,8 +25,8 @@ message PublishResponse {
// limit: maximum number of peers to search for // limit: maximum number of peers to search for
// flags: flags to search for // flags: flags to search for
message DiscoverRequest { message DiscoverRequest {
uint32 limit = 1; uint32 limit = 1;
repeated string flags = 2; repeated string flags = 2;
} }
// Server -> Client // Server -> Client
@@ -34,11 +34,11 @@ message DiscoverRequest {
// status: 0 if successful, anything else is an error // status: 0 if successful, anything else is an error
// peers: a list of peers, empty if nothing is found // peers: a list of peers, empty if nothing is found
message DiscoverResponse { message DiscoverResponse {
message DiscoverPeer { message DiscoverPeer {
uint32 port = 1; uint32 port = 1;
fixed64 address = 2; fixed64 address = 2;
repeated string flags = 3; repeated string flags = 3;
} }
uint32 status = 1; uint32 status = 1;
repeated DiscoverPeer peers = 2; repeated DiscoverPeer peers = 2;
} }