-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: adds back health proto * feat: adds is_alive/1 function * fix: health request * feat: adds spec for public APIs
- Loading branch information
1 parent
05bb76b
commit 28c9644
Showing
8 changed files
with
763 additions
and
7 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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
syntax = "proto3"; | ||
|
||
package greptime.v1; | ||
|
||
option java_package = "io.greptime.v1"; | ||
option java_outer_classname = "Health"; | ||
option go_package = "github.com/GreptimeTeam/greptime-proto/go/greptime/v1"; | ||
|
||
|
||
service HealthCheck { | ||
rpc HealthCheck(HealthCheckRequest) returns (HealthCheckResponse); | ||
} | ||
|
||
message HealthCheckRequest {} | ||
|
||
message HealthCheckResponse {} |
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,13 @@ | ||
%%%------------------------------------------------------------------- | ||
%% @doc Behaviour to implement for grpc service greptime.v1.HealthCheck. | ||
%% @end | ||
%%%------------------------------------------------------------------- | ||
|
||
%% this module was generated and should not be modified manually | ||
|
||
-module(greptime_v_1_health_check_bhvr). | ||
|
||
%% Unary RPC | ||
-callback health_check(ctx:t(), health_pb:health_check_request()) -> | ||
{ok, health_pb:health_check_response(), ctx:t()} | grpcbox_stream:grpc_error_response(). | ||
|
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,43 @@ | ||
%%%------------------------------------------------------------------- | ||
%% @doc Client module for grpc service greptime.v1.HealthCheck. | ||
%% @end | ||
%%%------------------------------------------------------------------- | ||
|
||
%% this module was generated and should not be modified manually | ||
|
||
-module(greptime_v_1_health_check_client). | ||
|
||
-compile(export_all). | ||
-compile(nowarn_export_all). | ||
|
||
-include_lib("grpcbox/include/grpcbox.hrl"). | ||
|
||
-define(is_ctx(Ctx), is_tuple(Ctx) andalso element(1, Ctx) =:= ctx). | ||
|
||
-define(SERVICE, 'greptime.v1.HealthCheck'). | ||
-define(PROTO_MODULE, 'health_pb'). | ||
-define(MARSHAL_FUN(T), fun(I) -> ?PROTO_MODULE:encode_msg(I, T) end). | ||
-define(UNMARSHAL_FUN(T), fun(I) -> ?PROTO_MODULE:decode_msg(I, T) end). | ||
-define(DEF(Input, Output, MessageType), #grpcbox_def{service=?SERVICE, | ||
message_type=MessageType, | ||
marshal_fun=?MARSHAL_FUN(Input), | ||
unmarshal_fun=?UNMARSHAL_FUN(Output)}). | ||
|
||
%% @doc Unary RPC | ||
-spec health_check(health_pb:health_check_request()) -> | ||
{ok, health_pb:health_check_response(), grpcbox:metadata()} | grpcbox_stream:grpc_error_response() | {error, any()}. | ||
health_check(Input) -> | ||
health_check(ctx:new(), Input, #{}). | ||
|
||
-spec health_check(ctx:t() | health_pb:health_check_request(), health_pb:health_check_request() | grpcbox_client:options()) -> | ||
{ok, health_pb:health_check_response(), grpcbox:metadata()} | grpcbox_stream:grpc_error_response() | {error, any()}. | ||
health_check(Ctx, Input) when ?is_ctx(Ctx) -> | ||
health_check(Ctx, Input, #{}); | ||
health_check(Input, Options) -> | ||
health_check(ctx:new(), Input, Options). | ||
|
||
-spec health_check(ctx:t(), health_pb:health_check_request(), grpcbox_client:options()) -> | ||
{ok, health_pb:health_check_response(), grpcbox:metadata()} | grpcbox_stream:grpc_error_response() | {error, any()}. | ||
health_check(Ctx, Input, Options) -> | ||
grpcbox_client:unary(Ctx, <<"/greptime.v1.HealthCheck/HealthCheck">>, Input, ?DEF(health_check_request, health_check_response, <<"greptime.v1.HealthCheckRequest">>), Options). | ||
|
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
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
Oops, something went wrong.