Skip to content

Commit

Permalink
Merge pull request #1552 from murgatroid99/grpc-js_xds_interop_client
Browse files Browse the repository at this point in the history
grpc-js: Enable the xds URL scheme and add an interop test for it
  • Loading branch information
murgatroid99 committed Sep 10, 2020
2 parents 2445875 + 46ac39b commit 5e0feb5
Show file tree
Hide file tree
Showing 44 changed files with 1,948 additions and 109 deletions.
26 changes: 26 additions & 0 deletions packages/grpc-js/interop/generated/grpc/testing/BoolValue.ts
@@ -0,0 +1,26 @@
// Original file: proto/grpc/testing/messages.proto


/**
* TODO(dgq): Go back to using well-known types once
* https://github.com/grpc/grpc/issues/6980 has been fixed.
* import "google/protobuf/wrappers.proto";
*/
export interface BoolValue {
/**
* The bool value.
*/
'value'?: (boolean);
}

/**
* TODO(dgq): Go back to using well-known types once
* https://github.com/grpc/grpc/issues/6980 has been fixed.
* import "google/protobuf/wrappers.proto";
*/
export interface BoolValue__Output {
/**
* The bool value.
*/
'value': (boolean);
}
20 changes: 20 additions & 0 deletions packages/grpc-js/interop/generated/grpc/testing/EchoStatus.ts
@@ -0,0 +1,20 @@
// Original file: proto/grpc/testing/messages.proto


/**
* A protobuf representation for grpc status. This is used by test
* clients to specify a status that the server should attempt to return.
*/
export interface EchoStatus {
'code'?: (number);
'message'?: (string);
}

/**
* A protobuf representation for grpc status. This is used by test
* clients to specify a status that the server should attempt to return.
*/
export interface EchoStatus__Output {
'code': (number);
'message': (string);
}
26 changes: 26 additions & 0 deletions packages/grpc-js/interop/generated/grpc/testing/Empty.ts
@@ -0,0 +1,26 @@
// Original file: proto/grpc/testing/empty.proto


/**
* An empty message that you can re-use to avoid defining duplicated empty
* messages in your project. A typical example is to use it as argument or the
* return value of a service API. For instance:
*
* service Foo {
* rpc Bar (grpc.testing.Empty) returns (grpc.testing.Empty) { };
* };
*/
export interface Empty {
}

/**
* An empty message that you can re-use to avoid defining duplicated empty
* messages in your project. A typical example is to use it as argument or the
* return value of a service API. For instance:
*
* service Foo {
* rpc Bar (grpc.testing.Empty) returns (grpc.testing.Empty) { };
* };
*/
export interface Empty__Output {
}
24 changes: 24 additions & 0 deletions packages/grpc-js/interop/generated/grpc/testing/GrpclbRouteType.ts
@@ -0,0 +1,24 @@
// Original file: proto/grpc/testing/messages.proto

/**
* The type of route that a client took to reach a server w.r.t. gRPCLB.
* The server must fill in "fallback" if it detects that the RPC reached
* the server via the "gRPCLB fallback" path, and "backend" if it detects
* that the RPC reached the server via "gRPCLB backend" path (i.e. if it got
* the address of this server from the gRPCLB server BalanceLoad RPC). Exactly
* how this detection is done is context and server dependent.
*/
export enum GrpclbRouteType {
/**
* Server didn't detect the route that a client took to reach it.
*/
GRPCLB_ROUTE_TYPE_UNKNOWN = 0,
/**
* Indicates that a client reached a server via gRPCLB fallback.
*/
GRPCLB_ROUTE_TYPE_FALLBACK = 1,
/**
* Indicates that a client reached a server as a gRPCLB-given backend.
*/
GRPCLB_ROUTE_TYPE_BACKEND = 2,
}
@@ -0,0 +1,24 @@
// Original file: proto/grpc/testing/messages.proto


export interface LoadBalancerStatsRequest {
/**
* Request stats for the next num_rpcs sent by client.
*/
'num_rpcs'?: (number);
/**
* If num_rpcs have not completed within timeout_sec, return partial results.
*/
'timeout_sec'?: (number);
}

export interface LoadBalancerStatsRequest__Output {
/**
* Request stats for the next num_rpcs sent by client.
*/
'num_rpcs': (number);
/**
* If num_rpcs have not completed within timeout_sec, return partial results.
*/
'timeout_sec': (number);
}
@@ -0,0 +1,40 @@
// Original file: proto/grpc/testing/messages.proto


export interface _grpc_testing_LoadBalancerStatsResponse_RpcsByPeer {
/**
* The number of completed RPCs for each peer.
*/
'rpcs_by_peer'?: ({[key: string]: number});
}

export interface _grpc_testing_LoadBalancerStatsResponse_RpcsByPeer__Output {
/**
* The number of completed RPCs for each peer.
*/
'rpcs_by_peer': ({[key: string]: number});
}

export interface LoadBalancerStatsResponse {
/**
* The number of completed RPCs for each peer.
*/
'rpcs_by_peer'?: ({[key: string]: number});
/**
* The number of RPCs that failed to record a remote peer.
*/
'num_failures'?: (number);
'rpcs_by_method'?: ({[key: string]: _grpc_testing_LoadBalancerStatsResponse_RpcsByPeer});
}

export interface LoadBalancerStatsResponse__Output {
/**
* The number of completed RPCs for each peer.
*/
'rpcs_by_peer': ({[key: string]: number});
/**
* The number of RPCs that failed to record a remote peer.
*/
'num_failures': (number);
'rpcs_by_method'?: ({[key: string]: _grpc_testing_LoadBalancerStatsResponse_RpcsByPeer__Output});
}
@@ -0,0 +1,37 @@
// Original file: proto/grpc/testing/test.proto

import * as grpc from '../../../../src'
import { LoadBalancerStatsRequest as _grpc_testing_LoadBalancerStatsRequest, LoadBalancerStatsRequest__Output as _grpc_testing_LoadBalancerStatsRequest__Output } from '../../grpc/testing/LoadBalancerStatsRequest';
import { LoadBalancerStatsResponse as _grpc_testing_LoadBalancerStatsResponse, LoadBalancerStatsResponse__Output as _grpc_testing_LoadBalancerStatsResponse__Output } from '../../grpc/testing/LoadBalancerStatsResponse';

/**
* A service used to obtain stats for verifying LB behavior.
*/
export interface LoadBalancerStatsServiceClient extends grpc.Client {
/**
* Gets the backend distribution for RPCs sent by a test client.
*/
GetClientStats(argument: _grpc_testing_LoadBalancerStatsRequest, metadata: grpc.Metadata, options: grpc.CallOptions, callback: (error?: grpc.ServiceError, result?: _grpc_testing_LoadBalancerStatsResponse__Output) => void): grpc.ClientUnaryCall;
GetClientStats(argument: _grpc_testing_LoadBalancerStatsRequest, metadata: grpc.Metadata, callback: (error?: grpc.ServiceError, result?: _grpc_testing_LoadBalancerStatsResponse__Output) => void): grpc.ClientUnaryCall;
GetClientStats(argument: _grpc_testing_LoadBalancerStatsRequest, options: grpc.CallOptions, callback: (error?: grpc.ServiceError, result?: _grpc_testing_LoadBalancerStatsResponse__Output) => void): grpc.ClientUnaryCall;
GetClientStats(argument: _grpc_testing_LoadBalancerStatsRequest, callback: (error?: grpc.ServiceError, result?: _grpc_testing_LoadBalancerStatsResponse__Output) => void): grpc.ClientUnaryCall;
/**
* Gets the backend distribution for RPCs sent by a test client.
*/
getClientStats(argument: _grpc_testing_LoadBalancerStatsRequest, metadata: grpc.Metadata, options: grpc.CallOptions, callback: (error?: grpc.ServiceError, result?: _grpc_testing_LoadBalancerStatsResponse__Output) => void): grpc.ClientUnaryCall;
getClientStats(argument: _grpc_testing_LoadBalancerStatsRequest, metadata: grpc.Metadata, callback: (error?: grpc.ServiceError, result?: _grpc_testing_LoadBalancerStatsResponse__Output) => void): grpc.ClientUnaryCall;
getClientStats(argument: _grpc_testing_LoadBalancerStatsRequest, options: grpc.CallOptions, callback: (error?: grpc.ServiceError, result?: _grpc_testing_LoadBalancerStatsResponse__Output) => void): grpc.ClientUnaryCall;
getClientStats(argument: _grpc_testing_LoadBalancerStatsRequest, callback: (error?: grpc.ServiceError, result?: _grpc_testing_LoadBalancerStatsResponse__Output) => void): grpc.ClientUnaryCall;

}

/**
* A service used to obtain stats for verifying LB behavior.
*/
export interface LoadBalancerStatsServiceHandlers extends grpc.UntypedServiceImplementation {
/**
* Gets the backend distribution for RPCs sent by a test client.
*/
GetClientStats(call: grpc.ServerUnaryCall<_grpc_testing_LoadBalancerStatsRequest__Output, _grpc_testing_LoadBalancerStatsResponse>, callback: grpc.sendUnaryData<_grpc_testing_LoadBalancerStatsResponse>): void;

}
31 changes: 31 additions & 0 deletions packages/grpc-js/interop/generated/grpc/testing/Payload.ts
@@ -0,0 +1,31 @@
// Original file: proto/grpc/testing/messages.proto

import { PayloadType as _grpc_testing_PayloadType } from '../../grpc/testing/PayloadType';

/**
* A block of data, to simply increase gRPC message size.
*/
export interface Payload {
/**
* The type of data in body.
*/
'type'?: (_grpc_testing_PayloadType | keyof typeof _grpc_testing_PayloadType);
/**
* Primary contents of payload.
*/
'body'?: (Buffer | Uint8Array | string);
}

/**
* A block of data, to simply increase gRPC message size.
*/
export interface Payload__Output {
/**
* The type of data in body.
*/
'type': (keyof typeof _grpc_testing_PayloadType);
/**
* Primary contents of payload.
*/
'body': (Buffer);
}
11 changes: 11 additions & 0 deletions packages/grpc-js/interop/generated/grpc/testing/PayloadType.ts
@@ -0,0 +1,11 @@
// Original file: proto/grpc/testing/messages.proto

/**
* The type of payload that should be returned.
*/
export enum PayloadType {
/**
* Compressable text format.
*/
COMPRESSABLE = 0,
}
22 changes: 22 additions & 0 deletions packages/grpc-js/interop/generated/grpc/testing/ReconnectInfo.ts
@@ -0,0 +1,22 @@
// Original file: proto/grpc/testing/messages.proto


/**
* For reconnect interop test only.
* Server tells client whether its reconnects are following the spec and the
* reconnect backoffs it saw.
*/
export interface ReconnectInfo {
'passed'?: (boolean);
'backoff_ms'?: (number)[];
}

/**
* For reconnect interop test only.
* Server tells client whether its reconnects are following the spec and the
* reconnect backoffs it saw.
*/
export interface ReconnectInfo__Output {
'passed': (boolean);
'backoff_ms': (number)[];
}
18 changes: 18 additions & 0 deletions packages/grpc-js/interop/generated/grpc/testing/ReconnectParams.ts
@@ -0,0 +1,18 @@
// Original file: proto/grpc/testing/messages.proto


/**
* For reconnect interop test only.
* Client tells server what reconnection parameters it used.
*/
export interface ReconnectParams {
'max_reconnect_backoff_ms'?: (number);
}

/**
* For reconnect interop test only.
* Client tells server what reconnection parameters it used.
*/
export interface ReconnectParams__Output {
'max_reconnect_backoff_ms': (number);
}
@@ -0,0 +1,40 @@
// Original file: proto/grpc/testing/test.proto

import * as grpc from '../../../../src'
import { Empty as _grpc_testing_Empty, Empty__Output as _grpc_testing_Empty__Output } from '../../grpc/testing/Empty';
import { ReconnectInfo as _grpc_testing_ReconnectInfo, ReconnectInfo__Output as _grpc_testing_ReconnectInfo__Output } from '../../grpc/testing/ReconnectInfo';
import { ReconnectParams as _grpc_testing_ReconnectParams, ReconnectParams__Output as _grpc_testing_ReconnectParams__Output } from '../../grpc/testing/ReconnectParams';

/**
* A service used to control reconnect server.
*/
export interface ReconnectServiceClient extends grpc.Client {
Start(argument: _grpc_testing_ReconnectParams, metadata: grpc.Metadata, options: grpc.CallOptions, callback: (error?: grpc.ServiceError, result?: _grpc_testing_Empty__Output) => void): grpc.ClientUnaryCall;
Start(argument: _grpc_testing_ReconnectParams, metadata: grpc.Metadata, callback: (error?: grpc.ServiceError, result?: _grpc_testing_Empty__Output) => void): grpc.ClientUnaryCall;
Start(argument: _grpc_testing_ReconnectParams, options: grpc.CallOptions, callback: (error?: grpc.ServiceError, result?: _grpc_testing_Empty__Output) => void): grpc.ClientUnaryCall;
Start(argument: _grpc_testing_ReconnectParams, callback: (error?: grpc.ServiceError, result?: _grpc_testing_Empty__Output) => void): grpc.ClientUnaryCall;
start(argument: _grpc_testing_ReconnectParams, metadata: grpc.Metadata, options: grpc.CallOptions, callback: (error?: grpc.ServiceError, result?: _grpc_testing_Empty__Output) => void): grpc.ClientUnaryCall;
start(argument: _grpc_testing_ReconnectParams, metadata: grpc.Metadata, callback: (error?: grpc.ServiceError, result?: _grpc_testing_Empty__Output) => void): grpc.ClientUnaryCall;
start(argument: _grpc_testing_ReconnectParams, options: grpc.CallOptions, callback: (error?: grpc.ServiceError, result?: _grpc_testing_Empty__Output) => void): grpc.ClientUnaryCall;
start(argument: _grpc_testing_ReconnectParams, callback: (error?: grpc.ServiceError, result?: _grpc_testing_Empty__Output) => void): grpc.ClientUnaryCall;

Stop(argument: _grpc_testing_Empty, metadata: grpc.Metadata, options: grpc.CallOptions, callback: (error?: grpc.ServiceError, result?: _grpc_testing_ReconnectInfo__Output) => void): grpc.ClientUnaryCall;
Stop(argument: _grpc_testing_Empty, metadata: grpc.Metadata, callback: (error?: grpc.ServiceError, result?: _grpc_testing_ReconnectInfo__Output) => void): grpc.ClientUnaryCall;
Stop(argument: _grpc_testing_Empty, options: grpc.CallOptions, callback: (error?: grpc.ServiceError, result?: _grpc_testing_ReconnectInfo__Output) => void): grpc.ClientUnaryCall;
Stop(argument: _grpc_testing_Empty, callback: (error?: grpc.ServiceError, result?: _grpc_testing_ReconnectInfo__Output) => void): grpc.ClientUnaryCall;
stop(argument: _grpc_testing_Empty, metadata: grpc.Metadata, options: grpc.CallOptions, callback: (error?: grpc.ServiceError, result?: _grpc_testing_ReconnectInfo__Output) => void): grpc.ClientUnaryCall;
stop(argument: _grpc_testing_Empty, metadata: grpc.Metadata, callback: (error?: grpc.ServiceError, result?: _grpc_testing_ReconnectInfo__Output) => void): grpc.ClientUnaryCall;
stop(argument: _grpc_testing_Empty, options: grpc.CallOptions, callback: (error?: grpc.ServiceError, result?: _grpc_testing_ReconnectInfo__Output) => void): grpc.ClientUnaryCall;
stop(argument: _grpc_testing_Empty, callback: (error?: grpc.ServiceError, result?: _grpc_testing_ReconnectInfo__Output) => void): grpc.ClientUnaryCall;

}

/**
* A service used to control reconnect server.
*/
export interface ReconnectServiceHandlers extends grpc.UntypedServiceImplementation {
Start(call: grpc.ServerUnaryCall<_grpc_testing_ReconnectParams__Output, _grpc_testing_Empty>, callback: grpc.sendUnaryData<_grpc_testing_Empty>): void;

Stop(call: grpc.ServerUnaryCall<_grpc_testing_Empty__Output, _grpc_testing_ReconnectInfo>, callback: grpc.sendUnaryData<_grpc_testing_ReconnectInfo>): void;

}
@@ -0,0 +1,47 @@
// Original file: proto/grpc/testing/messages.proto

import { BoolValue as _grpc_testing_BoolValue, BoolValue__Output as _grpc_testing_BoolValue__Output } from '../../grpc/testing/BoolValue';

/**
* Configuration for a particular response.
*/
export interface ResponseParameters {
/**
* Desired payload sizes in responses from the server.
*/
'size'?: (number);
/**
* Desired interval between consecutive responses in the response stream in
* microseconds.
*/
'interval_us'?: (number);
/**
* Whether to request the server to compress the response. This field is
* "nullable" in order to interoperate seamlessly with clients not able to
* implement the full compression tests by introspecting the call to verify
* the response's compression status.
*/
'compressed'?: (_grpc_testing_BoolValue);
}

/**
* Configuration for a particular response.
*/
export interface ResponseParameters__Output {
/**
* Desired payload sizes in responses from the server.
*/
'size': (number);
/**
* Desired interval between consecutive responses in the response stream in
* microseconds.
*/
'interval_us': (number);
/**
* Whether to request the server to compress the response. This field is
* "nullable" in order to interoperate seamlessly with clients not able to
* implement the full compression tests by introspecting the call to verify
* the response's compression status.
*/
'compressed'?: (_grpc_testing_BoolValue__Output);
}

0 comments on commit 5e0feb5

Please sign in to comment.