class MockGrpcTransport extends GrpcTransport (View source)

internal  
 

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(mixed $mockCall = null)

No description

static GrpcTransport
build(string $apiEndpoint, 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.

PromiseInterface
startUnaryCall(Call $call, array $options)

Returns a promise used to execute network requests.

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

No description

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

No description

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

No description

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

No description

getRequestArguments()

No description

Details

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

No description

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)

No description

Parameters

array $arr

Associative array

array $requiredKeys

List of keys to check for in $arr

Return Value

array

Returns $arr for fluent use

__construct(mixed $mockCall = null)

No description

Parameters

mixed $mockCall

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 (see https://grpc.github.io/grpc/core/group__grpc__arg__keys.html). @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 {\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 {\Google\ApiCore\Transport\Grpc\Interceptor}. @type callable $clientCertSource A callable which returns the client cert as a string. }

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(string $method, array $arguments, callable $deserialize, array $metadata = [], array $options = [])

No description

Parameters

string $method
array $arguments
callable $deserialize
array $metadata
array $options

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

No description

Parameters

string $method
callable $deserialize
array $metadata
array $options

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

No description

Parameters

string $method
array $arguments
callable $deserialize
array $metadata
array $options

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

No description

Parameters

string $method
callable $deserialize
array $metadata
array $options

getRequestArguments()

No description