-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add grpc plugin and Implemented code generation for gRPC services
Signed-off-by: castlighting <[email protected]>
- Loading branch information
1 parent
e79c915
commit 5e98bff
Showing
3 changed files
with
103 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
syntax = "proto3"; | ||
package proto; | ||
option java_multiple_files = true; | ||
option java_package = "io.opengemini.client.proto"; | ||
option java_outer_classname = "WriteProto"; | ||
|
||
// WriteService represents a openGemini RPC write service. | ||
service WriteService { | ||
// Write writes the given records to the specified database and retention policy. | ||
rpc Write (WriteRequest) returns (WriteResponse) {} | ||
// Ping is used to check if the server is alive | ||
rpc Ping(PingRequest) returns (PingResponse) {} | ||
} | ||
|
||
message WriteRequest { | ||
uint32 version = 1; | ||
string database = 2; | ||
string retention_policy = 3; | ||
string username = 4; | ||
string password = 5; | ||
repeated Record records = 6; | ||
} | ||
|
||
message WriteResponse { | ||
ResponseCode code = 1; | ||
} | ||
|
||
message Record { | ||
string measurement = 1; | ||
int64 min_time = 2; | ||
int64 max_time = 3; | ||
CompressMethod compress_method = 4; | ||
bytes block = 5; | ||
} | ||
|
||
enum CompressMethod { | ||
UNCOMPRESSED = 0; | ||
LZ4_FAST = 1; | ||
ZSTD_FAST = 2; | ||
SNAPPY = 3; | ||
} | ||
|
||
enum ResponseCode { | ||
Success = 0; | ||
Partial = 1; | ||
Failed = 2; | ||
} | ||
|
||
message PingRequest { | ||
string client_id = 1; | ||
} | ||
|
||
enum ServerStatus { | ||
Up = 0; | ||
Down = 1; | ||
Unknown = 99; | ||
} | ||
|
||
message PingResponse { | ||
ServerStatus status = 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters