templates.ScalaCommon.txt.ApiTrait.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.12 Show documentation
Show all versions of pekko-grpc-codegen_2.12 Show documentation
Apache Pekko gRPC - Support for building streaming gRPC servers and clients on top of Pekko Streams.
The newest version!
package templates.ScalaCommon.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 ApiTrait 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.scaladsl.Service,play.twirl.api.TxtFormat.Appendable] {
/*
* Copyright (C) 2018-2021 Lightbend Inc.
*/
def apply/*14.2*/(service: org.apache.pekko.grpc.gen.scaladsl.Service):play.twirl.api.TxtFormat.Appendable = {
_display_ {
{
def /*35.2*/mapMethodType/*35.15*/(methodType: org.apache.pekko.grpc.gen.MethodType):play.twirl.api.TxtFormat.Appendable = {_display_(
Seq[Any](format.raw/*35.69*/("""
"""),_display_(if(methodType == org.apache.pekko.grpc.gen.Unary)/*36.53*/ {_display_(Seq[Any](format.raw/*36.55*/(""" """),format.raw/*36.56*/("""MethodDescriptor.MethodType.UNARY """)))} else {null} ),format.raw/*36.91*/("""
"""),_display_(if(methodType == org.apache.pekko.grpc.gen.ClientStreaming)/*37.63*/ {_display_(Seq[Any](format.raw/*37.65*/("""MethodDescriptor.MethodType.CLIENT_STREAMING """)))} else {null} ),format.raw/*37.111*/("""
"""),_display_(if(methodType == org.apache.pekko.grpc.gen.ServerStreaming)/*38.63*/ {_display_(Seq[Any](format.raw/*38.65*/(""" """),format.raw/*38.66*/("""MethodDescriptor.MethodType.SERVER_STREAMING """)))} else {null} ),format.raw/*38.112*/("""
"""),_display_(if(methodType == org.apache.pekko.grpc.gen.BidiStreaming)/*39.61*/ {_display_(Seq[Any](format.raw/*39.63*/("""MethodDescriptor.MethodType.BIDI_STREAMING """)))} else {null} ),format.raw/*39.107*/("""
""")))};
Seq[Any](format.raw/*15.1*/("""
"""),_display_(/*16.2*/org/*16.5*/.apache.pekko.grpc.gen.Constants.DoNotEditComment),format.raw/*16.54*/("""
"""),format.raw/*17.1*/("""package """),_display_(/*17.10*/service/*17.17*/.packageName),format.raw/*17.29*/("""
"""),format.raw/*19.1*/("""import org.apache.pekko
import pekko.annotation.ApiMayChange
import pekko.grpc.PekkoGrpcGenerated
"""),_display_(/*24.2*/for(comment <- service.comment) yield /*24.33*/ {_display_(Seq[Any](format.raw/*24.35*/("""/**
"""),_display_(/*25.2*/{java.util.regex.Pattern.compile("^\\s?(.*)$", java.util.regex.Pattern.MULTILINE).matcher(comment).replaceAll(" * $1")}),format.raw/*25.121*/(""" """),format.raw/*25.122*/("""*/""")))}),format.raw/*25.125*/("""
"""),format.raw/*26.1*/("""@PekkoGrpcGenerated
trait """),_display_(/*27.8*/{service.name}),format.raw/*27.22*/(""" """),format.raw/*27.23*/("""{"""),format.raw/*27.24*/("""
"""),_display_(/*28.4*/for(method <- service.methods) yield /*28.34*/ {_display_(Seq[Any](format.raw/*28.36*/("""
"""),_display_(/*29.4*/for(comment <- method.comment) yield /*29.34*/ {_display_(Seq[Any](format.raw/*29.36*/("""/**
"""),_display_(/*30.2*/{java.util.regex.Pattern.compile("^\\s?(.*)$", java.util.regex.Pattern.MULTILINE).matcher(comment).replaceAll(" * $1")}),format.raw/*30.123*/(""" """),format.raw/*30.126*/("""*/""")))}),format.raw/*30.129*/("""
"""),format.raw/*31.3*/("""def """),_display_(/*31.8*/{method.nameSafe}),format.raw/*31.25*/("""(in: """),_display_(/*31.31*/method/*31.37*/.parameterType),format.raw/*31.51*/("""): """),_display_(/*31.55*/method/*31.61*/.returnType),format.raw/*31.72*/("""
""")))}),format.raw/*32.4*/("""
"""),format.raw/*33.1*/("""}"""),format.raw/*33.2*/("""
"""),format.raw/*40.2*/("""
"""),format.raw/*42.1*/("""@PekkoGrpcGenerated
object """),_display_(/*43.9*/{service.name}),format.raw/*43.23*/(""" """),format.raw/*43.24*/("""extends pekko.grpc.ServiceDescription """),format.raw/*43.62*/("""{"""),format.raw/*43.63*/("""
"""),format.raw/*44.3*/("""val name = """"),_display_(/*44.16*/service/*44.23*/.grpcName),format.raw/*44.32*/(""""
val descriptor: com.google.protobuf.Descriptors.FileDescriptor =
"""),_display_(/*47.6*/service/*47.13*/.descriptor),format.raw/*47.24*/(""";
object Serializers """),format.raw/*49.22*/("""{"""),format.raw/*49.23*/("""
"""),format.raw/*50.5*/("""import pekko.grpc.scaladsl.ScalapbProtobufSerializer
"""),_display_(/*51.6*/for(serializer <- service.serializers) yield /*51.44*/ {_display_(Seq[Any](format.raw/*51.46*/("""
"""),format.raw/*52.5*/("""val """),_display_(/*52.10*/serializer/*52.20*/.name),format.raw/*52.25*/(""" """),format.raw/*52.26*/("""= """),_display_(/*52.29*/serializer/*52.39*/.init),format.raw/*52.44*/("""
""")))}),format.raw/*53.6*/("""
"""),format.raw/*54.3*/("""}"""),format.raw/*54.4*/("""
"""),format.raw/*56.3*/("""@ApiMayChange
@PekkoGrpcGenerated
object MethodDescriptors """),format.raw/*58.28*/("""{"""),format.raw/*58.29*/("""
"""),format.raw/*59.5*/("""import pekko.grpc.internal.Marshaller
import io.grpc.MethodDescriptor
import Serializers."""),_display_(/*61.25*/{service.scalaCompatConstants.WildcardImport}),format.raw/*61.70*/("""
"""),_display_(/*63.6*/for(method <- service.methods) yield /*63.36*/ {_display_(Seq[Any](format.raw/*63.38*/("""
"""),format.raw/*64.5*/("""val """),_display_(/*64.10*/{method.name}),format.raw/*64.23*/("""Descriptor: MethodDescriptor["""),_display_(/*64.53*/method/*64.59*/.inputTypeUnboxed),format.raw/*64.76*/(""", """),_display_(/*64.79*/method/*64.85*/.outputTypeUnboxed),format.raw/*64.103*/("""] =
MethodDescriptor.newBuilder()
.setType("""),_display_(/*66.19*/mapMethodType(method.methodType)),format.raw/*66.51*/(""")
.setFullMethodName(MethodDescriptor.generateFullMethodName(""""),_display_(/*67.70*/service/*67.77*/.grpcName),format.raw/*67.86*/("""", """"),_display_(/*67.91*/method/*67.97*/.grpcName),format.raw/*67.106*/(""""))
.setRequestMarshaller(new Marshaller("""),_display_(/*68.47*/method/*68.53*/.deserializer.name),format.raw/*68.71*/("""))
.setResponseMarshaller(new Marshaller("""),_display_(/*69.48*/method/*69.54*/.serializer.name),format.raw/*69.70*/("""))
.setSampledToLocalTracing(true)
.build()
""")))}),format.raw/*72.6*/("""
"""),format.raw/*73.3*/("""}"""),format.raw/*73.4*/("""
"""),format.raw/*74.1*/("""}"""),format.raw/*74.2*/("""
"""))
}
}
}
def render(service:org.apache.pekko.grpc.gen.scaladsl.Service): play.twirl.api.TxtFormat.Appendable = apply(service)
def f:((org.apache.pekko.grpc.gen.scaladsl.Service) => play.twirl.api.TxtFormat.Appendable) = (service) => apply(service)
def ref: this.type = this
}
/*
-- GENERATED --
SOURCE: codegen/src/main/twirl/templates/ScalaCommon/ApiTrait.scala.txt
HASH: a970e847f136cb69b3cb77e563ebec109fa6d8a0
MATRIX: 689->364|820->1095|842->1108|972->1162|1052->1215|1092->1217|1121->1218|1200->1253|1290->1316|1330->1318|1421->1364|1511->1427|1551->1429|1580->1430|1671->1476|1759->1537|1799->1539|1888->1583|1929->418|1957->420|1968->423|2038->472|2066->473|2102->482|2118->489|2151->501|2180->503|2307->604|2354->635|2394->637|2425->642|2566->761|2596->762|2631->765|2659->766|2712->794|2747->808|2776->809|2805->810|2835->814|2881->844|2921->846|2951->850|2997->880|3037->882|3068->887|3211->1008|3243->1011|3278->1014|3308->1017|3339->1022|3377->1039|3410->1045|3425->1051|3460->1065|3491->1069|3506->1075|3538->1086|3572->1090|3600->1091|3628->1092|3657->1585|3686->1587|3740->1616|3775->1630|3804->1631|3870->1669|3899->1670|3929->1673|3969->1686|3985->1693|4015->1702|4116->1777|4132->1784|4164->1795|4216->1819|4245->1820|4277->1825|4361->1883|4415->1921|4455->1923|4487->1928|4519->1933|4538->1943|4564->1948|4593->1949|4623->1952|4642->1962|4668->1967|4704->1973|4734->1976|4762->1977|4793->1981|4884->2046|4913->2047|4945->2052|5070->2150|5136->2195|5169->2202|5215->2232|5255->2234|5287->2239|5319->2244|5353->2257|5410->2287|5425->2293|5463->2310|5493->2313|5508->2319|5548->2337|5633->2395|5686->2427|5784->2498|5800->2505|5830->2514|5862->2519|5877->2525|5908->2534|5985->2584|6000->2590|6039->2608|6116->2658|6131->2664|6168->2680|6263->2745|6293->2748|6321->2749|6349->2750|6377->2751
LINES: 16->14|20->35|20->35|22->35|23->36|23->36|23->36|23->36|24->37|24->37|24->37|25->38|25->38|25->38|25->38|26->39|26->39|26->39|28->15|29->16|29->16|29->16|30->17|30->17|30->17|30->17|32->19|37->24|37->24|37->24|38->25|38->25|38->25|38->25|39->26|40->27|40->27|40->27|40->27|41->28|41->28|41->28|42->29|42->29|42->29|43->30|43->30|43->30|43->30|44->31|44->31|44->31|44->31|44->31|44->31|44->31|44->31|44->31|45->32|46->33|46->33|48->40|50->42|51->43|51->43|51->43|51->43|51->43|52->44|52->44|52->44|52->44|55->47|55->47|55->47|57->49|57->49|58->50|59->51|59->51|59->51|60->52|60->52|60->52|60->52|60->52|60->52|60->52|60->52|61->53|62->54|62->54|64->56|66->58|66->58|67->59|69->61|69->61|71->63|71->63|71->63|72->64|72->64|72->64|72->64|72->64|72->64|72->64|72->64|72->64|74->66|74->66|75->67|75->67|75->67|75->67|75->67|75->67|76->68|76->68|76->68|77->69|77->69|77->69|80->72|81->73|81->73|82->74|82->74
-- GENERATED --
*/
© 2015 - 2025 Weber Informatics LLC | Privacy Policy