class MockGrpcTransport extends GrpcTransport (View source)

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 $apiEndpoint, array $config = [])

Builds a GrpcTransport.

BidiStream
startBidiStreamingCall(Call $call, array $options)

Starts a bidi streaming call.

ClientStream
startClientStreamingCall(Call $call, array $options)

Starts a client streaming call.

ServerStream
startServerStreamingCall(Call $call, array $options)

Starts a server streaming call.

PromiseInterface
startUnaryCall(Call $call, array $options)

Returns a promise used to execute network requests.

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

No description

_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

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

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

__construct($mockCall = null)

Parameters

$mockCall

Exceptions

Exception

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

Builds a GrpcTransport.

Parameters

string $apiEndpoint 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 Interceptor[]|UnaryInterceptorInterface[] $interceptors EXPERIMENTAL Interceptors used to intercept RPC invocations before a call starts. Please note that implementations of {see \Google\ApiCore\Transport\Grpc\UnaryInterceptorInterface} are considered deprecated and support will be removed in a future release. To prepare for this, please take the time to convert UnaryInterceptorInterface implementations over to a class which extends {see \Grpc\Interceptor}. }

Return Value

GrpcTransport

Exceptions

ValidationException

BidiStream startBidiStreamingCall(Call $call, array $options)

Starts a bidi streaming call.

Parameters

Call $call
array $options

Return Value

BidiStream

ClientStream startClientStreamingCall(Call $call, array $options)

Starts a client streaming call.

Parameters

Call $call
array $options

Return Value

ClientStream

ServerStream startServerStreamingCall(Call $call, array $options)

Starts a server streaming call.

Parameters

Call $call
array $options

Return Value

ServerStream

PromiseInterface startUnaryCall(Call $call, array $options)

Returns a promise used to execute network requests.

Parameters

Call $call
array $options

Return Value

PromiseInterface

Exceptions

ValidationException

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

Parameters

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

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

Parameters

$method
$deserialize
array $metadata
array $options

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

Parameters

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

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

Parameters

$method
$deserialize
array $metadata
array $options

getRequestArguments()