diff --git a/README.md b/README.md new file mode 100644 index 0000000..45b54d6 --- /dev/null +++ b/README.md @@ -0,0 +1,15 @@ +# CodeCtrl Protobuf Files + +This repository contains the files that define the communication between the +CodeCtrl language loggers and the CodeCtrl log server that runs in the +background. This repository is intended to be used as a submodule for each +language logger to use to build against. + +gPRC-specific documentation for most languages can be seen +[here](https://grpc.io/docs/languages/), though not all languages are listed. +Rust has [tonic](https://crates.io/crates/tonic) which is what is being used +inside CodeCtrl and works more than well enough. C has +[juniper/gprc-c](https://github.com/juniper/grpc-c), but it seems unmaintained, +may be worth using the main gPRC repo and using the core library instead as +mentioned in the [table under this heading in the main +repository](https://github.com/grpc/grpc#about-this-repository). diff --git a/backtrace_data.proto b/backtrace_data.proto new file mode 100644 index 0000000..5546ce2 --- /dev/null +++ b/backtrace_data.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; + +package backtrace_data; + +message BacktraceData { + string name = 1; + string filePath = 2; + uint32 lineNumber = 3; + uint32 columnNumber = 4; + string code = 5; +} diff --git a/cc-service.proto b/cc-service.proto new file mode 100644 index 0000000..34f0093 --- /dev/null +++ b/cc-service.proto @@ -0,0 +1,29 @@ + +syntax = "proto3"; + +package logs_service; + +import "log.proto"; + +message Empty {} + +enum Received { + CONFIRMED = 0; + ERROR = 1; +} + +message ReceivedResult { + string message = 1; + Received status = 2; +} + +service Logs { + // Implemented and used by the GUI + rpc GetLog(Empty) returns (log.Log) {} + rpc GetLogs(Empty) returns (stream log.Log) {} + + // Implemented and used by each language logger + rpc SendLog(log.Log) returns (ReceivedResult) {} + rpc SendLogs(stream log.Log) returns (ReceivedResult) {} +} + diff --git a/log.proto b/log.proto new file mode 100644 index 0000000..9e34443 --- /dev/null +++ b/log.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; + +package log; + +import "backtrace_data.proto"; + +message Log { + repeated backtrace_data.BacktraceData stack = 1; + uint32 lineNumber = 2; + map codeSnippet = 3; + string message = 4; + string messageType = 5; + string fileName = 6; + string address = 7; + string language = 8; + repeated string warnings = 9; +}