github.com/tickoalcantara12/micro/v3@v3.0.0-20221007104245-9d75b9bcbab9/proto/events/events.proto (about) 1 syntax = "proto3"; 2 3 package events; 4 option go_package = "github.com/tickoalcantara12/micro/v3/proto/event;events"; 5 6 service Stream { 7 rpc Publish(PublishRequest) returns (PublishResponse); 8 rpc Consume(ConsumeRequest) returns (stream Event); 9 } 10 11 service Store { 12 rpc Read(ReadRequest) returns (ReadResponse); 13 rpc Write(WriteRequest) returns (WriteResponse); 14 } 15 16 message PublishRequest { 17 string topic = 1; 18 map<string, string> metadata = 2; 19 bytes payload = 3; 20 int64 timestamp = 4; 21 } 22 23 message PublishResponse {} 24 25 message ConsumeRequest { 26 string group = 1; 27 string topic = 2; 28 int64 offset = 3; 29 bool auto_ack = 4; 30 // duration in nanoseconds 31 int64 ack_wait = 5; 32 int64 retry_limit = 6; 33 } 34 35 message Event { 36 string id = 1; 37 string topic = 2; 38 map<string, string> metadata = 3; 39 bytes payload = 4; 40 int64 timestamp = 5; 41 } 42 43 message ReadRequest { 44 string topic = 1; 45 uint64 limit = 2; 46 uint64 offset = 3; 47 } 48 49 message ReadResponse { 50 repeated Event events = 1; 51 } 52 53 message WriteRequest { 54 Event event = 1; 55 int64 ttl = 2; 56 } 57 58 message WriteResponse {} 59 60 message AckRequest { 61 string id = 1; 62 bool success = 2; 63 }