From 7397d60ec09d303eca2af541e4da81f779c2d7e8 Mon Sep 17 00:00:00 2001 From: Rasyid Hakim Date: Wed, 24 Mar 2021 15:00:58 +0700 Subject: [PATCH] feat: add raccoon proto --- buf.yaml | 7 +++++ src/odpf/proton/raccoon/Event.proto | 16 +++++++++++ src/odpf/proton/raccoon/EventRequest.proto | 16 +++++++++++ src/odpf/proton/raccoon/EventResponse.proto | 30 +++++++++++++++++++++ 4 files changed, 69 insertions(+) create mode 100644 buf.yaml create mode 100644 src/odpf/proton/raccoon/Event.proto create mode 100644 src/odpf/proton/raccoon/EventRequest.proto create mode 100644 src/odpf/proton/raccoon/EventResponse.proto diff --git a/buf.yaml b/buf.yaml new file mode 100644 index 00000000..3151f13c --- /dev/null +++ b/buf.yaml @@ -0,0 +1,7 @@ +version: v1beta1 +build: + roots: + - ./src +breaking: + use: + - WIRE \ No newline at end of file diff --git a/src/odpf/proton/raccoon/Event.proto b/src/odpf/proton/raccoon/Event.proto new file mode 100644 index 00000000..551820db --- /dev/null +++ b/src/odpf/proton/raccoon/Event.proto @@ -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; + } \ No newline at end of file diff --git a/src/odpf/proton/raccoon/EventRequest.proto b/src/odpf/proton/raccoon/EventRequest.proto new file mode 100644 index 00000000..f005db73 --- /dev/null +++ b/src/odpf/proton/raccoon/EventRequest.proto @@ -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; +} \ No newline at end of file diff --git a/src/odpf/proton/raccoon/EventResponse.proto b/src/odpf/proton/raccoon/EventResponse.proto new file mode 100644 index 00000000..ca2d6a14 --- /dev/null +++ b/src/odpf/proton/raccoon/EventResponse.proto @@ -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 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; +}