Move to grpc default health service definition

This commit is contained in:
Peter 2021-05-02 17:34:29 +02:00
parent f3416157dd
commit 74f521c653
3 changed files with 31 additions and 34 deletions

View file

@ -14,6 +14,8 @@ lint:
- DEFAULT
except:
- PACKAGE_DIRECTORY_MATCH
ignore:
- grpc/health/v1/
allow_comment_ignores: true
breaking:
use:

View file

@ -0,0 +1,29 @@
syntax = "proto3";
package grpc.health.v1;
option csharp_namespace = "INetMock.Client.Rpc";
option go_package = "gitlab.com/inetmock/inetmock/pkg/grpc/health/v1";
option java_multiple_files = true;
option java_outer_classname = "HealthProto";
option java_package = "com.github.baez90.inetmock.rpc";
message HealthCheckRequest {
string service = 1;
}
message HealthCheckResponse {
enum ServingStatus {
UNKNOWN = 0;
SERVING = 1;
NOT_SERVING = 2;
SERVICE_UNKNOWN = 3; // Used only by the Watch method.
}
ServingStatus status = 1;
}
service Health {
rpc Check(HealthCheckRequest) returns (HealthCheckResponse);
rpc Watch(HealthCheckRequest) returns (stream HealthCheckResponse);
}

View file

@ -1,34 +0,0 @@
syntax = "proto3";
package inetmock.rpc.v1;
option csharp_namespace = "INetMock.Client.Rpc";
option go_package = "gitlab.com/inetmock/inetmock/pkg/rpc/v1";
option java_multiple_files = true;
option java_outer_classname = "HealthProto";
option java_package = "com.github.baez90.inetmock.rpc";
enum HealthState {
HEALTH_STATE_UNSPECIFIED = 0;
HEALTH_STATE_INITIALIZING = 1;
HEALTH_STATE_UNHEALTHY = 2;
HEALTH_STATE_HEALTHY = 3;
}
message GetHealthRequest {
repeated string components = 1;
}
message ComponentHealth {
HealthState state = 1;
string message = 2;
}
message GetHealthResponse {
HealthState overall_health_state = 1;
map<string, ComponentHealth> components_health = 2;
}
service HealthService {
rpc GetHealth(GetHealthRequest) returns (GetHealthResponse);
}