GrpcProtocol

@InternalApi

INTERNAL API

Core definitions for gRPC protocols.

Companion:
class
Source:
GrpcProtocol.scala
class Object
trait Matchable
class Any

Type members

Classlikes

case class DataFrame(data: ByteString) extends Frame

A data (or message) frame in a gRPC protocol stream.

A data (or message) frame in a gRPC protocol stream.

Source:
GrpcProtocol.scala
sealed trait Frame

A frame in a logical gRPC protocol stream

A frame in a logical gRPC protocol stream

Source:
GrpcProtocol.scala
case class GrpcProtocolReader(messageEncoding: Codec, decodeSingleFrame: ByteString => ByteString, frameDecoder: Flow[ByteString, Frame, NotUsed])

Implements the decoding of the gRPC framing from a physical/transport layer.

Implements the decoding of the gRPC framing from a physical/transport layer.

Source:
GrpcProtocol.scala
case class GrpcProtocolWriter(contentType: ContentType, messageEncoding: Codec, encodeFrame: Frame => ChunkStreamPart, encodeDataToResponse: (ByteString, Seq[HttpHeader], Trailer) => HttpResponse, frameEncoder: Flow[Frame, ChunkStreamPart, NotUsed])

Implements the encoding of a stream of gRPC Frames into a physical/transport layer.

Implements the encoding of a stream of gRPC Frames into a physical/transport layer.

This maps the logical gRPC frames into a stream of chunks that can be handled by the HTTP/2 or HTTP/1.1 transport layer.

Source:
GrpcProtocol.scala
case class TrailerFrame(trailers: List[HttpHeader]) extends Frame

A trailer (status headers) frame in a gRPC protocol stream

A trailer (status headers) frame in a gRPC protocol stream

Source:
GrpcProtocol.scala

Value members

Concrete methods

def detect(request: HttpRequest): Option[GrpcProtocol]

Detects which gRPC protocol variant is indicated in a request.

Detects which gRPC protocol variant is indicated in a request.

Returns:

a GrpcProtocol matching the request mediatype if specified and known.

Source:
GrpcProtocol.scala
def detect(mediaType: MediaType): Option[GrpcProtocol]

Detects which gRPC protocol variant is indicated by a mediatype.

Detects which gRPC protocol variant is indicated by a mediatype.

Returns:

a GrpcProtocol matching the request mediatype if known.

Source:
GrpcProtocol.scala
def negotiate(request: HttpRequest): Option[(Try[GrpcProtocolReader], GrpcProtocolWriter)]

Calculates the gRPC protocol encoding to use for an interaction with a gRPC client.

Calculates the gRPC protocol encoding to use for an interaction with a gRPC client.

Value parameters:
request

the client request to respond to.

Returns:

the protocol reader for the request, and a protocol writer for the response.

Source:
GrpcProtocol.scala