Merge branch 'healthservice' into 'main'
add health service See merge request v3/service/auth!27
This commit is contained in:
commit
ffd4108419
|
@ -24,6 +24,12 @@ import { AuthenticationPresenter } from './authentication.presenter';
|
|||
import { RpcValidationPipe } from '../../../../utils/pipes/rpc.validation-pipe';
|
||||
import { UsernamePresenter } from './username.presenter';
|
||||
|
||||
enum ServingStatus {
|
||||
UNKNOWN = 0,
|
||||
SERVING = 1,
|
||||
NOT_SERVING = 2,
|
||||
}
|
||||
|
||||
@UsePipes(
|
||||
new RpcValidationPipe({
|
||||
whitelist: true,
|
||||
|
@ -185,4 +191,11 @@ export class AuthenticationController {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
@GrpcMethod('Health', 'Check')
|
||||
async check(): Promise<{ status: ServingStatus }> {
|
||||
return {
|
||||
status: ServingStatus.SERVING,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,3 +40,20 @@ message Uuid {
|
|||
}
|
||||
|
||||
message Empty {}
|
||||
|
||||
service Health {
|
||||
rpc Check(HealthCheckRequest) returns (HealthCheckResponse);
|
||||
}
|
||||
|
||||
message HealthCheckRequest {
|
||||
string service = 1;
|
||||
}
|
||||
|
||||
message HealthCheckResponse {
|
||||
enum ServingStatus {
|
||||
UNKNOWN = 0;
|
||||
SERVING = 1;
|
||||
NOT_SERVING = 2;
|
||||
}
|
||||
ServingStatus status = 1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue