Skip to content

Commit

Permalink
minor formatting adjustment of templates (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
patriknw authored and raboof committed Mar 15, 2018
1 parent 8ff5f01 commit b1ab613
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ import akka.stream.scaladsl.Source

trait @{service.name} {
@for(method <- service.methods) {
def @{method.name}(
in: @method.parameterType
):
@method.returnType
def @{method.name}(in: @method.parameterType): @method.returnType
}
}

Expand All @@ -25,4 +22,4 @@ object @{service.name} {
val @serializer.name = @serializer.init
}
}
}
}
16 changes: 4 additions & 12 deletions codegen/src/main/twirl/templates/ScalaServer/Client.scala.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,10 @@ class @{service.name}Client(channel: Channel, options: CallOptions)(implicit mat
}

@mapMethodType(methodType: akka.http.grpc.MethodType) = {
@if(methodType == akka.http.grpc.Unary) {
MethodDescriptor.MethodType.UNARY
}
@if(methodType == akka.http.grpc.ClientStreaming) {
MethodDescriptor.MethodType.CLIENT_STREAMING
}
@if(methodType == akka.http.grpc.ServerStreaming) {
MethodDescriptor.MethodType.SERVER_STREAMING
}
@if(methodType == akka.http.grpc.BidiStreaming) {
MethodDescriptor.MethodType.BIDI_STREAMING
}
@if(methodType == akka.http.grpc.Unary) { MethodDescriptor.MethodType.UNARY }
@if(methodType == akka.http.grpc.ClientStreaming) {MethodDescriptor.MethodType.CLIENT_STREAMING }
@if(methodType == akka.http.grpc.ServerStreaming) { MethodDescriptor.MethodType.SERVER_STREAMING }
@if(methodType == akka.http.grpc.BidiStreaming) {MethodDescriptor.MethodType.BIDI_STREAMING }
}

object @{service.name}Client {
Expand Down

0 comments on commit b1ab613

Please sign in to comment.