object GrpcProtocol
INTERNAL API
Core definitions for gRPC protocols.
- Annotations
- @InternalApi()
- Source
- GrpcProtocol.scala
- Alphabetic
- By Inheritance
- GrpcProtocol
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
case class
DataFrame(data: ByteString) extends Frame with Product with Serializable
A data (or message) frame in a gRPC protocol stream.
-
sealed
trait
Frame extends AnyRef
A frame in a logical gRPC protocol stream
-
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.
-
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.
-
case class
TrailerFrame(trailers: List[HttpHeader]) extends Frame with Product with Serializable
A trailer (status headers) frame in a gRPC protocol stream
Value Members
-
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.
-
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.
-
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.