templates.JavaClient.txt.GenMethodImports.template.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pekko-grpc-codegen_2.13 Show documentation
Show all versions of pekko-grpc-codegen_2.13 Show documentation
Apache Pekko gRPC - Support for building streaming gRPC servers and clients on top of Pekko Streams.
The newest version!
package templates.JavaClient.txt
import _root_.play.twirl.api.TwirlFeatureImports._
import _root_.play.twirl.api.TwirlHelperImports._
import _root_.play.twirl.api.Html
import _root_.play.twirl.api.JavaScript
import _root_.play.twirl.api.Txt
import _root_.play.twirl.api.Xml
object GenMethodImports extends _root_.play.twirl.api.BaseScalaTemplate[play.twirl.api.TxtFormat.Appendable,_root_.play.twirl.api.Format[play.twirl.api.TxtFormat.Appendable]](play.twirl.api.TxtFormat) with _root_.play.twirl.api.Template1[org.apache.pekko.grpc.gen.javadsl.Service,play.twirl.api.TxtFormat.Appendable] {
/*
* Copyright (C) 2019-2021 Lightbend Inc.
*/
def apply/*14.2*/(service: org.apache.pekko.grpc.gen.javadsl.Service):play.twirl.api.TxtFormat.Appendable = {
_display_ {
{
Seq[Any](format.raw/*15.1*/("""
"""),_display_(/*16.2*/{
val singleResponse = "import org.apache.pekko.grpc.javadsl.SingleResponseRequestBuilder;"
val streamResponse = "import org.apache.pekko.grpc.javadsl.StreamResponseRequestBuilder;"
service.methods.map(_.methodType).map {
case org.apache.pekko.grpc.gen.Unary => singleResponse
case org.apache.pekko.grpc.gen.ClientStreaming => singleResponse
case org.apache.pekko.grpc.gen.ServerStreaming => streamResponse
case org.apache.pekko.grpc.gen.BidiStreaming => streamResponse
}.distinct.mkString("\n")
}),format.raw/*25.2*/("""
"""))
}
}
}
def render(service:org.apache.pekko.grpc.gen.javadsl.Service): play.twirl.api.TxtFormat.Appendable = apply(service)
def f:((org.apache.pekko.grpc.gen.javadsl.Service) => play.twirl.api.TxtFormat.Appendable) = (service) => apply(service)
def ref: this.type = this
}
/*
-- GENERATED --
SOURCE: codegen/src/main/twirl/templates/JavaClient/GenMethodImports.scala.txt
HASH: 419081ccc53e58d539ef7c4fb60819b708b4289e
MATRIX: 695->364|841->417|869->419|1418->948
LINES: 16->14|21->15|22->16|31->25
-- GENERATED --
*/
© 2015 - 2025 Weber Informatics LLC | Privacy Policy