class MockGrpcTransport extends GrpcTransport

Traits

Provides helper methods for gRPC support.
Provides helper methods for service address handling.

Methods

static array
validate(array $arr, array $requiredKeys)

No description

static array
validateNotNull(array $arr, array $requiredKeys)

No description

__construct($mockCall = null)

No description

static GrpcTransport
build(string $serviceAddress, array $config = [])

Builds a GrpcTransport.

startBidiStreamingCall(Call $call, array $options)

Starts a bidi streaming call.

startClientStreamingCall(Call $call, array $options)

Starts a client streaming call.

startServerStreamingCall(Call $call, array $options)

Starts a server streaming call.

_simpleRequest($method, $arguments, $deserialize, array $metadata = [], array $options = [])

No description

PromiseInterface
startUnaryCall(Call $call, array $options)

Returns a promise used to execute network requests.

_clientStreamRequest($method, $deserialize, array $metadata = [], array $options = [])

No description

_serverStreamRequest($method, $arguments, $deserialize, array $metadata = [], array $options = [])

No description

_bidiRequest($method, $deserialize, array $metadata = [], array $options = [])

No description

getRequestArguments()

No description

Details

in ValidationTrait at line 41
static array validate(array $arr, array $requiredKeys)

Parameters

array $arr Associative array
array $requiredKeys List of keys to check for in $arr

Return Value

array Returns $arr for fluent use

in ValidationTrait at line 51
static array validateNotNull(array $arr, array $requiredKeys)

Parameters

array $arr Associative array
array $requiredKeys List of keys to check for in $arr

Return Value

array Returns $arr for fluent use

at line 48
__construct($mockCall = null)

Parameters

$mockCall

in GrpcTransport at line 97
static GrpcTransport build(string $serviceAddress, array $config = [])

Builds a GrpcTransport.

Parameters

string $serviceAddress The address of the API remote host, for example "example.googleapis.com. May also include the port, for example "example.googleapis.com:443"
array $config { Config options used to construct the gRPC transport.

@type array $stubOpts Options used to construct the gRPC stub. @type Channel $channel Grpc channel to be used. @type UnaryInterceptorInterface[] $interceptors EXPERIMENTAL Interceptor support, required until gRPC interceptors are available. }

Return Value

GrpcTransport

Exceptions

ValidationException

in GrpcTransport at line 134
BidiStream startBidiStreamingCall(Call $call, array $options)

Starts a bidi streaming call.

Parameters

Call $call
array $options

Return Value

BidiStream

in GrpcTransport at line 150
ClientStream startClientStreamingCall(Call $call, array $options)

Starts a client streaming call.

Parameters

Call $call
array $options

Return Value

ClientStream

in GrpcTransport at line 166
ServerStream startServerStreamingCall(Call $call, array $options)

Starts a server streaming call.

Parameters

Call $call
array $options

Return Value

ServerStream

at line 55
protected _simpleRequest($method, $arguments, $deserialize, array $metadata = [], array $options = [])

Parameters

$method
$arguments
$deserialize
array $metadata
array $options

in GrpcTransport at line 228
PromiseInterface startUnaryCall(Call $call, array $options)

Returns a promise used to execute network requests.

Parameters

Call $call
array $options

Return Value

PromiseInterface

at line 66
protected _clientStreamRequest($method, $deserialize, array $metadata = [], array $options = [])

Parameters

$method
$deserialize
array $metadata
array $options

at line 76
protected _serverStreamRequest($method, $arguments, $deserialize, array $metadata = [], array $options = [])

Parameters

$method
$arguments
$deserialize
array $metadata
array $options

at line 87
protected _bidiRequest($method, $deserialize, array $metadata = [], array $options = [])

Parameters

$method
$deserialize
array $metadata
array $options

at line 113
getRequestArguments()