object GrpcProtocol

INTERNAL API

Core definitions for gRPC protocols.

Annotations
@InternalApi()
Source
GrpcProtocol.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. GrpcProtocol
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. case class DataFrame(data: ByteString) extends Frame with Product with Serializable

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

  2. sealed trait Frame extends AnyRef

    A frame in a logical gRPC protocol stream

  3. case class GrpcProtocolReader(messageEncoding: Codec, decodeSingleFrame: (ByteString) ⇒ ByteString, frameDecoder: Flow[ByteString, Frame, NotUsed]) extends Product with Serializable

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

  4. case class GrpcProtocolWriter(contentType: ContentType, messageEncoding: Codec, encodeFrame: (Frame) ⇒ ChunkStreamPart, encodeDataToResponse: (ByteString, Seq[HttpHeader], Trailer) ⇒ HttpResponse, frameEncoder: Flow[Frame, ChunkStreamPart, NotUsed]) extends Product with Serializable

    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.

  5. case class TrailerFrame(trailers: List[HttpHeader]) extends Frame with Product with Serializable

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

Value Members

  1. 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.

  2. 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.

  3. 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.

    request

    the client request to respond to.

    returns

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