Skip to content

Commit

Permalink
feat: initial protocol definition
Browse files Browse the repository at this point in the history
Signed-off-by: rgallor <riccardo.gallo@secomind.com>
  • Loading branch information
rgallor committed Oct 5, 2023
1 parent 245b368 commit 114081d
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 0 deletions.
30 changes: 30 additions & 0 deletions proto/edgehog/device/forwarder/http.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Copyright 2023 SECO Mind Srl
// SPDX-License-Identifier: Apache-2.0

syntax = "proto3";

package edgehog.device.forwarder;

message Http {
oneof message {
Request request = 1;
Response response = 2;
}

message Request {
bytes request_id = 1;
string path = 2;
string method = 3;
string query_string = 4;
map<string, string> headers = 5;
bytes body = 6;
uint32 port = 7;
}

message Response {
bytes request_id = 1;
uint32 status_code = 2;
map<string, string> headers = 3;
bytes body = 4;
}
}
16 changes: 16 additions & 0 deletions proto/edgehog/device/forwarder/message.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Copyright 2023 SECO Mind Srl
// SPDX-License-Identifier: Apache-2.0

syntax = "proto3";

package edgehog.device.forwarder;

import "edgehog/device/forwarder/http.proto";
import "edgehog/device/forwarder/ws.proto";

message Message {
oneof protocol {
Http http = 1;
WebSocket ws = 2;
}
}
23 changes: 23 additions & 0 deletions proto/edgehog/device/forwarder/ws.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright 2023 SECO Mind Srl
// SPDX-License-Identifier: Apache-2.0

syntax = "proto3";

package edgehog.device.forwarder;

message WebSocket {
bytes socket_id = 1;

oneof message {
string text = 2;
bytes binary = 3;
bytes ping = 4;
bytes pong = 5;
Close close = 6;
}

message Close {
uint32 code = 1;
string reason = 2;
}
}

0 comments on commit 114081d

Please sign in to comment.