-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: dashjay <[email protected]>
- Loading branch information
Showing
12 changed files
with
930 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,5 @@ | |
|
||
# Go workspace file | ||
go.work | ||
|
||
.idea/ |
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,8 @@ | ||
.PHONY: proto | ||
|
||
proto: | ||
protoc \ | ||
--go-grpc_out="${PWD}"/api \ | ||
--go_out="${PWD}"/api \ | ||
-I "${PWD}/api/hlcv1" \ | ||
hlcv1.proto |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,32 @@ | ||
syntax = "proto3"; | ||
|
||
package hlcv1; | ||
|
||
import "google/protobuf/empty.proto"; | ||
|
||
option go_package = "/hlcv1"; | ||
|
||
|
||
message GetResp { | ||
int64 clock = 1; | ||
} | ||
|
||
message BatchGetReq { | ||
// default count is 1, means that only get one. | ||
uint32 count = 1; | ||
// if count is more than two, return_first can be set to reduce the size of the response | ||
bool return_first = 2; | ||
} | ||
|
||
message BatchGetResp { | ||
BatchGetReq Req = 1; | ||
// if return_first specified true, first clock will be set | ||
int64 first = 2; | ||
// if request count more than one and return_first = false, all clock allocated will be set here | ||
repeated int64 clocks = 3; | ||
} | ||
|
||
service HCLService{ | ||
rpc Get(google.protobuf.Empty) returns(GetResp); | ||
rpc BatchGet(BatchGetReq) returns(BatchGetResp); | ||
} |
Oops, something went wrong.