Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
Signed-off-by: dashjay <[email protected]>
  • Loading branch information
dashjay committed Apr 1, 2024
1 parent b586c52 commit 0b8da8d
Show file tree
Hide file tree
Showing 12 changed files with 930 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@

# Go workspace file
go.work

.idea/
8 changes: 8 additions & 0 deletions Makefile
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
316 changes: 316 additions & 0 deletions api/hlcv1/hlcv1.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions api/hlcv1/hlcv1.proto
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);
}
Loading

0 comments on commit 0b8da8d

Please sign in to comment.