Skip to content
This repository has been archived by the owner on Jun 22, 2023. It is now read-only.

Commit

Permalink
Initial commit of protobuf specifications
Browse files Browse the repository at this point in the history
  • Loading branch information
STBoyden committed Jun 29, 2022
0 parents commit 00e5549
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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).
11 changes: 11 additions & 0 deletions backtrace_data.proto
Original file line number Diff line number Diff line change
@@ -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;
}
29 changes: 29 additions & 0 deletions cc-service.proto
Original file line number Diff line number Diff line change
@@ -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) {}
}

17 changes: 17 additions & 0 deletions log.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
syntax = "proto3";

package log;

import "backtrace_data.proto";

message Log {
repeated backtrace_data.BacktraceData stack = 1;
uint32 lineNumber = 2;
map<string, string> codeSnippet = 3;
string message = 4;
string messageType = 5;
string fileName = 6;
string address = 7;
string language = 8;
repeated string warnings = 9;
}

0 comments on commit 00e5549

Please sign in to comment.