class StatusCodec

internal  
 

Methods

static array
encode(Status $status)

Encode a gRPC status as final wire fields.

static Status|null
parse(array $headers, int $httpStatus, bool $endStream)

Parse a final gRPC status event.

static Status
fromHttpStatus(int $httpStatus)

Map an HTTP response without grpc-status to a gRPC status.

static bool
isTrailersOnly(array $headers, bool $initialEvent, bool $endStream)

Determine whether an event is a trailers-only response.

static string
encodeMessage(string $message)

Percent-encode a gRPC status message.

static string
decodeMessage(string $message)

Tolerantly decode a gRPC status message.

Details

at line 23
static array encode(Status $status)

Encode a gRPC status as final wire fields.

Parameters

Status $status

Return Value

array

at line 46
static Status|null parse(array $headers, int $httpStatus, bool $endStream)

Parse a final gRPC status event.

Parameters

array $headers
int $httpStatus
bool $endStream

Return Value

Status|null

at line 106
static Status fromHttpStatus(int $httpStatus)

Map an HTTP response without grpc-status to a gRPC status.

Parameters

int $httpStatus

Return Value

Status

at line 128
static bool isTrailersOnly(array $headers, bool $initialEvent, bool $endStream)

Determine whether an event is a trailers-only response.

Parameters

array $headers
bool $initialEvent
bool $endStream

Return Value

bool

at line 139
static string encodeMessage(string $message)

Percent-encode a gRPC status message.

Parameters

string $message

Return Value

string

at line 158
static string decodeMessage(string $message)

Tolerantly decode a gRPC status message.

Parameters

string $message

Return Value

string