Skip to content

Commit afbdbde

Browse files
committed
grpc-health-check: Add generated code for version 2.0
1 parent f68ceaa commit afbdbde

File tree

7 files changed

+259
-0
lines changed

7 files changed

+259
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Original file: proto/health/v1/health.proto
2+
3+
import type { MethodDefinition } from '@grpc/proto-loader'
4+
import type { HealthCheckRequest as _grpc_health_v1_HealthCheckRequest, HealthCheckRequest__Output as _grpc_health_v1_HealthCheckRequest__Output } from '../../../grpc/health/v1/HealthCheckRequest';
5+
import type { HealthCheckResponse as _grpc_health_v1_HealthCheckResponse, HealthCheckResponse__Output as _grpc_health_v1_HealthCheckResponse__Output } from '../../../grpc/health/v1/HealthCheckResponse';
6+
7+
export interface HealthDefinition {
8+
Check: MethodDefinition<_grpc_health_v1_HealthCheckRequest, _grpc_health_v1_HealthCheckResponse, _grpc_health_v1_HealthCheckRequest__Output, _grpc_health_v1_HealthCheckResponse__Output>
9+
Watch: MethodDefinition<_grpc_health_v1_HealthCheckRequest, _grpc_health_v1_HealthCheckResponse, _grpc_health_v1_HealthCheckRequest__Output, _grpc_health_v1_HealthCheckResponse__Output>
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Original file: proto/health/v1/health.proto
2+
3+
4+
export interface HealthCheckRequest {
5+
'service'?: (string);
6+
}
7+
8+
export interface HealthCheckRequest__Output {
9+
'service': (string);
10+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Original file: proto/health/v1/health.proto
2+
3+
4+
// Original file: proto/health/v1/health.proto
5+
6+
export const _grpc_health_v1_HealthCheckResponse_ServingStatus = {
7+
UNKNOWN: 'UNKNOWN',
8+
SERVING: 'SERVING',
9+
NOT_SERVING: 'NOT_SERVING',
10+
/**
11+
* Used only by the Watch method.
12+
*/
13+
SERVICE_UNKNOWN: 'SERVICE_UNKNOWN',
14+
} as const;
15+
16+
export type _grpc_health_v1_HealthCheckResponse_ServingStatus =
17+
| 'UNKNOWN'
18+
| 0
19+
| 'SERVING'
20+
| 1
21+
| 'NOT_SERVING'
22+
| 2
23+
/**
24+
* Used only by the Watch method.
25+
*/
26+
| 'SERVICE_UNKNOWN'
27+
| 3
28+
29+
export type _grpc_health_v1_HealthCheckResponse_ServingStatus__Output = typeof _grpc_health_v1_HealthCheckResponse_ServingStatus[keyof typeof _grpc_health_v1_HealthCheckResponse_ServingStatus]
30+
31+
export interface HealthCheckResponse {
32+
'status'?: (_grpc_health_v1_HealthCheckResponse_ServingStatus);
33+
}
34+
35+
export interface HealthCheckResponse__Output {
36+
'status': (_grpc_health_v1_HealthCheckResponse_ServingStatus__Output);
37+
}
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
// Original file: proto/health/v1/health.proto
2+
3+
import type * as grpc from '@grpc/grpc-js'
4+
import type { MethodDefinition } from '@grpc/proto-loader'
5+
import type { HealthCheckRequest as _grpc_health_v1_HealthCheckRequest, HealthCheckRequest__Output as _grpc_health_v1_HealthCheckRequest__Output } from '../../../grpc/health/v1/HealthCheckRequest';
6+
import type { HealthCheckResponse as _grpc_health_v1_HealthCheckResponse, HealthCheckResponse__Output as _grpc_health_v1_HealthCheckResponse__Output } from '../../../grpc/health/v1/HealthCheckResponse';
7+
8+
/**
9+
* Health is gRPC's mechanism for checking whether a server is able to handle
10+
* RPCs. Its semantics are documented in
11+
* https://github.com/grpc/grpc/blob/master/doc/health-checking.md.
12+
*/
13+
export interface HealthClient extends grpc.Client {
14+
/**
15+
* Check gets the health of the specified service. If the requested service
16+
* is unknown, the call will fail with status NOT_FOUND. If the caller does
17+
* not specify a service name, the server should respond with its overall
18+
* health status.
19+
*
20+
* Clients should set a deadline when calling Check, and can declare the
21+
* server unhealthy if they do not receive a timely response.
22+
*
23+
* Check implementations should be idempotent and side effect free.
24+
*/
25+
Check(argument: _grpc_health_v1_HealthCheckRequest, metadata: grpc.Metadata, options: grpc.CallOptions, callback: grpc.requestCallback<_grpc_health_v1_HealthCheckResponse__Output>): grpc.ClientUnaryCall;
26+
Check(argument: _grpc_health_v1_HealthCheckRequest, metadata: grpc.Metadata, callback: grpc.requestCallback<_grpc_health_v1_HealthCheckResponse__Output>): grpc.ClientUnaryCall;
27+
Check(argument: _grpc_health_v1_HealthCheckRequest, options: grpc.CallOptions, callback: grpc.requestCallback<_grpc_health_v1_HealthCheckResponse__Output>): grpc.ClientUnaryCall;
28+
Check(argument: _grpc_health_v1_HealthCheckRequest, callback: grpc.requestCallback<_grpc_health_v1_HealthCheckResponse__Output>): grpc.ClientUnaryCall;
29+
/**
30+
* Check gets the health of the specified service. If the requested service
31+
* is unknown, the call will fail with status NOT_FOUND. If the caller does
32+
* not specify a service name, the server should respond with its overall
33+
* health status.
34+
*
35+
* Clients should set a deadline when calling Check, and can declare the
36+
* server unhealthy if they do not receive a timely response.
37+
*
38+
* Check implementations should be idempotent and side effect free.
39+
*/
40+
check(argument: _grpc_health_v1_HealthCheckRequest, metadata: grpc.Metadata, options: grpc.CallOptions, callback: grpc.requestCallback<_grpc_health_v1_HealthCheckResponse__Output>): grpc.ClientUnaryCall;
41+
check(argument: _grpc_health_v1_HealthCheckRequest, metadata: grpc.Metadata, callback: grpc.requestCallback<_grpc_health_v1_HealthCheckResponse__Output>): grpc.ClientUnaryCall;
42+
check(argument: _grpc_health_v1_HealthCheckRequest, options: grpc.CallOptions, callback: grpc.requestCallback<_grpc_health_v1_HealthCheckResponse__Output>): grpc.ClientUnaryCall;
43+
check(argument: _grpc_health_v1_HealthCheckRequest, callback: grpc.requestCallback<_grpc_health_v1_HealthCheckResponse__Output>): grpc.ClientUnaryCall;
44+
45+
/**
46+
* Performs a watch for the serving status of the requested service.
47+
* The server will immediately send back a message indicating the current
48+
* serving status. It will then subsequently send a new message whenever
49+
* the service's serving status changes.
50+
*
51+
* If the requested service is unknown when the call is received, the
52+
* server will send a message setting the serving status to
53+
* SERVICE_UNKNOWN but will *not* terminate the call. If at some
54+
* future point, the serving status of the service becomes known, the
55+
* server will send a new message with the service's serving status.
56+
*
57+
* If the call terminates with status UNIMPLEMENTED, then clients
58+
* should assume this method is not supported and should not retry the
59+
* call. If the call terminates with any other status (including OK),
60+
* clients should retry the call with appropriate exponential backoff.
61+
*/
62+
Watch(argument: _grpc_health_v1_HealthCheckRequest, metadata: grpc.Metadata, options?: grpc.CallOptions): grpc.ClientReadableStream<_grpc_health_v1_HealthCheckResponse__Output>;
63+
Watch(argument: _grpc_health_v1_HealthCheckRequest, options?: grpc.CallOptions): grpc.ClientReadableStream<_grpc_health_v1_HealthCheckResponse__Output>;
64+
/**
65+
* Performs a watch for the serving status of the requested service.
66+
* The server will immediately send back a message indicating the current
67+
* serving status. It will then subsequently send a new message whenever
68+
* the service's serving status changes.
69+
*
70+
* If the requested service is unknown when the call is received, the
71+
* server will send a message setting the serving status to
72+
* SERVICE_UNKNOWN but will *not* terminate the call. If at some
73+
* future point, the serving status of the service becomes known, the
74+
* server will send a new message with the service's serving status.
75+
*
76+
* If the call terminates with status UNIMPLEMENTED, then clients
77+
* should assume this method is not supported and should not retry the
78+
* call. If the call terminates with any other status (including OK),
79+
* clients should retry the call with appropriate exponential backoff.
80+
*/
81+
watch(argument: _grpc_health_v1_HealthCheckRequest, metadata: grpc.Metadata, options?: grpc.CallOptions): grpc.ClientReadableStream<_grpc_health_v1_HealthCheckResponse__Output>;
82+
watch(argument: _grpc_health_v1_HealthCheckRequest, options?: grpc.CallOptions): grpc.ClientReadableStream<_grpc_health_v1_HealthCheckResponse__Output>;
83+
84+
}
85+
86+
/**
87+
* Health is gRPC's mechanism for checking whether a server is able to handle
88+
* RPCs. Its semantics are documented in
89+
* https://github.com/grpc/grpc/blob/master/doc/health-checking.md.
90+
*/
91+
export interface HealthHandlers extends grpc.UntypedServiceImplementation {
92+
/**
93+
* Check gets the health of the specified service. If the requested service
94+
* is unknown, the call will fail with status NOT_FOUND. If the caller does
95+
* not specify a service name, the server should respond with its overall
96+
* health status.
97+
*
98+
* Clients should set a deadline when calling Check, and can declare the
99+
* server unhealthy if they do not receive a timely response.
100+
*
101+
* Check implementations should be idempotent and side effect free.
102+
*/
103+
Check: grpc.handleUnaryCall<_grpc_health_v1_HealthCheckRequest__Output, _grpc_health_v1_HealthCheckResponse>;
104+
105+
/**
106+
* Performs a watch for the serving status of the requested service.
107+
* The server will immediately send back a message indicating the current
108+
* serving status. It will then subsequently send a new message whenever
109+
* the service's serving status changes.
110+
*
111+
* If the requested service is unknown when the call is received, the
112+
* server will send a message setting the serving status to
113+
* SERVICE_UNKNOWN but will *not* terminate the call. If at some
114+
* future point, the serving status of the service becomes known, the
115+
* server will send a new message with the service's serving status.
116+
*
117+
* If the call terminates with status UNIMPLEMENTED, then clients
118+
* should assume this method is not supported and should not retry the
119+
* call. If the call terminates with any other status (including OK),
120+
* clients should retry the call with appropriate exponential backoff.
121+
*/
122+
Watch: grpc.handleServerStreamingCall<_grpc_health_v1_HealthCheckRequest__Output, _grpc_health_v1_HealthCheckResponse>;
123+
124+
}
125+
126+
export interface HealthDefinition extends grpc.ServiceDefinition {
127+
Check: MethodDefinition<_grpc_health_v1_HealthCheckRequest, _grpc_health_v1_HealthCheckResponse, _grpc_health_v1_HealthCheckRequest__Output, _grpc_health_v1_HealthCheckResponse__Output>
128+
Watch: MethodDefinition<_grpc_health_v1_HealthCheckRequest, _grpc_health_v1_HealthCheckResponse, _grpc_health_v1_HealthCheckRequest__Output, _grpc_health_v1_HealthCheckResponse__Output>
129+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Original file: proto/health/v1/health.proto
2+
3+
4+
export interface HealthCheckRequest {
5+
'service'?: (string);
6+
}
7+
8+
export interface HealthCheckRequest__Output {
9+
'service': (string);
10+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Original file: proto/health/v1/health.proto
2+
3+
4+
// Original file: proto/health/v1/health.proto
5+
6+
export const _grpc_health_v1_HealthCheckResponse_ServingStatus = {
7+
UNKNOWN: 'UNKNOWN',
8+
SERVING: 'SERVING',
9+
NOT_SERVING: 'NOT_SERVING',
10+
/**
11+
* Used only by the Watch method.
12+
*/
13+
SERVICE_UNKNOWN: 'SERVICE_UNKNOWN',
14+
} as const;
15+
16+
export type _grpc_health_v1_HealthCheckResponse_ServingStatus =
17+
| 'UNKNOWN'
18+
| 0
19+
| 'SERVING'
20+
| 1
21+
| 'NOT_SERVING'
22+
| 2
23+
/**
24+
* Used only by the Watch method.
25+
*/
26+
| 'SERVICE_UNKNOWN'
27+
| 3
28+
29+
export type _grpc_health_v1_HealthCheckResponse_ServingStatus__Output = typeof _grpc_health_v1_HealthCheckResponse_ServingStatus[keyof typeof _grpc_health_v1_HealthCheckResponse_ServingStatus]
30+
31+
export interface HealthCheckResponse {
32+
'status'?: (_grpc_health_v1_HealthCheckResponse_ServingStatus);
33+
}
34+
35+
export interface HealthCheckResponse__Output {
36+
'status': (_grpc_health_v1_HealthCheckResponse_ServingStatus__Output);
37+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import type * as grpc from '@grpc/grpc-js';
2+
import type { MessageTypeDefinition } from '@grpc/proto-loader';
3+
4+
import type { HealthClient as _grpc_health_v1_HealthClient, HealthDefinition as _grpc_health_v1_HealthDefinition } from './grpc/health/v1/Health';
5+
6+
type SubtypeConstructor<Constructor extends new (...args: any) => any, Subtype> = {
7+
new(...args: ConstructorParameters<Constructor>): Subtype;
8+
};
9+
10+
export interface ProtoGrpcType {
11+
grpc: {
12+
health: {
13+
v1: {
14+
/**
15+
* Health is gRPC's mechanism for checking whether a server is able to handle
16+
* RPCs. Its semantics are documented in
17+
* https://github.com/grpc/grpc/blob/master/doc/health-checking.md.
18+
*/
19+
Health: SubtypeConstructor<typeof grpc.Client, _grpc_health_v1_HealthClient> & { service: _grpc_health_v1_HealthDefinition }
20+
HealthCheckRequest: MessageTypeDefinition
21+
HealthCheckResponse: MessageTypeDefinition
22+
}
23+
}
24+
}
25+
}
26+

0 commit comments

Comments
 (0)