class RestTransport implements TransportInterface

A REST based transport implementation.

Traits

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(RequestBuilder $requestBuilder, callable $httpHandler)

No description

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

Builds a RestTransport.

startClientStreamingCall(Call $call, array $options)

Starts a client streaming call.

startServerStreamingCall(Call $call, array $options)

Starts a server streaming call.

startBidiStreamingCall(Call $call, array $options)

Starts a bidi streaming call.

PromiseInterface
startUnaryCall(Call $call, array $options)

Returns a promise used to execute network requests.

close()

Closes the connection, if one exists.

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 64
__construct(RequestBuilder $requestBuilder, callable $httpHandler)

Parameters

RequestBuilder $requestBuilder A builder responsible for creating a PSR-7 request from a set of request information.
callable $httpHandler A handler used to deliver PSR-7 requests.

at line 87
static RestTransport build(string $serviceAddress, string $restConfigPath, array $config = [])

Builds a RestTransport.

Parameters

string $serviceAddress The address of the API remote host, for example "example.googleapis.com".
string $restConfigPath Path to rest config file.
array $config { Config options used to construct the gRPC transport.

@type callable $httpHandler A handler used to deliver PSR-7 requests. }

Return Value

RestTransport

Exceptions

ValidationException

at line 102
ClientStream startClientStreamingCall(Call $call, array $options)

Starts a client streaming call.

Parameters

Call $call
array $options

Return Value

ClientStream

at line 111
ServerStream startServerStreamingCall(Call $call, array $options)

Starts a server streaming call.

Parameters

Call $call
array $options

Return Value

ServerStream

at line 120
BidiStream startBidiStreamingCall(Call $call, array $options)

Starts a bidi streaming call.

Parameters

Call $call
array $options

Return Value

BidiStream

at line 128
PromiseInterface startUnaryCall(Call $call, array $options)

Returns a promise used to execute network requests.

Parameters

Call $call
array $options

Return Value

PromiseInterface

at line 176
close()

Closes the connection, if one exists.