grpc.reflection.v1alpha.reflection.ServerReflectionMarshallers.scala Maven / Gradle / Ivy
// Generated by Pekko gRPC. DO NOT EDIT.
package grpc.reflection.v1alpha.reflection
import scala.concurrent.ExecutionContext
import org.apache.pekko
import pekko.actor.ClassicActorSystemProvider
import pekko.stream.Materializer
import pekko.grpc.GrpcProtocol.GrpcProtocolWriter
import pekko.grpc.ProtobufSerializer
import pekko.grpc.scaladsl.GrpcMarshalling
import pekko.grpc.scaladsl.ScalapbProtobufSerializer
import pekko.http.scaladsl.marshalling.Marshaller
import pekko.http.scaladsl.marshalling.ToResponseMarshaller
import pekko.http.scaladsl.model.HttpRequest
import pekko.http.scaladsl.unmarshalling.FromRequestUnmarshaller
import pekko.http.scaladsl.unmarshalling.Unmarshaller
import pekko.grpc.PekkoGrpcGenerated
@PekkoGrpcGenerated
object ServerReflectionMarshallers {
implicit val ServerReflectionRequestSerializer: ScalapbProtobufSerializer[grpc.reflection.v1alpha.reflection.ServerReflectionRequest] = grpc.reflection.v1alpha.reflection.ServerReflection.Serializers.ServerReflectionRequestSerializer
implicit val ServerReflectionResponseSerializer: ScalapbProtobufSerializer[grpc.reflection.v1alpha.reflection.ServerReflectionResponse] = grpc.reflection.v1alpha.reflection.ServerReflection.Serializers.ServerReflectionResponseSerializer
implicit def unmarshaller[T](implicit serializer: ProtobufSerializer[T], mat: Materializer): FromRequestUnmarshaller[T] =
Unmarshaller((_: ExecutionContext) => (req: HttpRequest) => GrpcMarshalling.unmarshal(req)(serializer, mat))
implicit def toSourceUnmarshaller[T](implicit serializer: ProtobufSerializer[T], mat: Materializer): FromRequestUnmarshaller[pekko.stream.scaladsl.Source[T, pekko.NotUsed]] =
Unmarshaller((_: ExecutionContext) => (req: HttpRequest) => GrpcMarshalling.unmarshalStream(req)(serializer, mat))
implicit def marshaller[T](implicit serializer: ProtobufSerializer[T], writer: GrpcProtocolWriter, system: ClassicActorSystemProvider): ToResponseMarshaller[T] =
Marshaller.opaque((response: T) => GrpcMarshalling.marshal(response)(serializer, writer, system))
implicit def fromSourceMarshaller[T](implicit serializer: ProtobufSerializer[T], writer: GrpcProtocolWriter, system: ClassicActorSystemProvider): ToResponseMarshaller[pekko.stream.scaladsl.Source[T, pekko.NotUsed]] =
Marshaller.opaque((response: pekko.stream.scaladsl.Source[T, pekko.NotUsed]) => GrpcMarshalling.marshalStream(response)(serializer, writer, system))
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy