Skip to content

Commit

Permalink
feat: add raccoon proto
Browse files Browse the repository at this point in the history
  • Loading branch information
NNcrawler committed Mar 25, 2021
1 parent 528fc46 commit 7397d60
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 0 deletions.
7 changes: 7 additions & 0 deletions buf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: v1beta1
build:
roots:
- ./src
breaking:
use:
- WIRE
16 changes: 16 additions & 0 deletions src/odpf/proton/raccoon/Event.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
syntax = "proto3";

package odpf.proton.raccoon;

option java_multiple_files = true;
option java_package = "io.odpf.proton.raccoon";
option java_outer_classname = "EventProto";

message Event {
// Data/byteArray of the serialised product proto.
bytes eventBytes = 1;
/* This is the protoMessageName which the protoc provides with each compiled proto.
This type is used by raccoon to distribute events to respective Kafka topics.
*/
string type = 2;
}
16 changes: 16 additions & 0 deletions src/odpf/proton/raccoon/EventRequest.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
syntax = "proto3";

package odpf.proton.raccoon;

option java_multiple_files = true;
option java_package = "io.odpf.proton.raccoon";
option java_outer_classname = "EventRequestProto";

import "odpf/proton/raccoon/Event.proto";
import "google/protobuf/timestamp.proto";

message EventRequest {
string req_guid = 1;
google.protobuf.Timestamp sent_time = 2;
repeated Event events = 3;
}
30 changes: 30 additions & 0 deletions src/odpf/proton/raccoon/EventResponse.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
syntax = "proto3";

package odpf.proton.raccoon;

option java_multiple_files = true;
option java_package = "io.odpf.proton.raccoon";
option java_outer_classname = "EventResponseProto";

message EventResponse {
Status status = 1;
Code code = 2;
int64 sent_time = 3;
string reason = 4;
map<string, string> data = 5;
}

enum Status {
UNKNOWN_STATUS = 0;
SUCCESS = 1;
ERROR = 2;
}

enum Code {
UNKNOWN_CODE = 0;
OK = 1;
BAD_REQUEST = 2;
INTERNAL_ERROR = 3;
MAX_CONNECTION_LIMIT_REACHED = 4;
MAX_USER_LIMIT_REACHED = 5;
}

0 comments on commit 7397d60

Please sign in to comment.