Skip to content

Commit

Permalink
feat: add mongodb adaptors
Browse files Browse the repository at this point in the history
  • Loading branch information
Pippo98 committed Oct 2, 2024
1 parent ed70b23 commit 50fcdb1
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 0 deletions.
38 changes: 38 additions & 0 deletions proto/mongodb/lapcounter_lap_records.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
syntax = "proto3";

package MongoDb;

message LapRecord
{
string driver = 1;
uint64 start = 2;
uint64 end = 3;
repeated uint64 sectors = 4;
}

message SectorsRecord
{
string driver = 1;
uint64 start_time_sector = 2;
uint64 end_time_sector = 3;
}

message DriverRecord
{
string driver = 1;
LapRecord best_lap = 2;
repeated SectorsRecord best_sectors = 3;
}

message LapRecords
{
int32 version = 2;
int32 baseline_version = 3;
string vehicle_id = 4;
string device_id = 5;
string location = 6;
string layout = 7;
LapRecord best_lap = 8;
repeated SectorsRecord best_sectors = 9;
repeated DriverRecord drivers_records = 10;
}
21 changes: 21 additions & 0 deletions proto/mongodb/lapcounter_lap_times.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
syntax = "proto3";

package MongoDb;

message LapTime {
uint64 number = 1;
uint64 start_timestamp = 2;
uint64 end_timestamp = 3;
repeated uint64 sectors = 4;
}

message LapTimes {
int32 version = 2;
int32 baseline_version = 3;
string vehicle_id = 4;
string device_id = 5;
string location = 6;
string layout = 7;
string driver = 8;
repeated LapTime times = 9;
}
25 changes: 25 additions & 0 deletions proto/mongodb/lapcounter_layout.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
syntax = "proto3";

package MongoDb;

message Vec2 {
int32 x = 1;
int32 y = 2;
}

message PositionAndDirection {
Vec2 position = 1;
Vec2 direction = 2;
}

message Layout {
int32 version = 2;
int32 baseline_version = 3;
string vehicle_id = 4;
string device_id = 5;
string location = 6;
string layout = 7;
PositionAndDirection start_line = 8;
PositionAndDirection finish_line = 9;
repeated PositionAndDirection sectors = 10;
}

0 comments on commit 50fcdb1

Please sign in to comment.