-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replaced GrpcErrorResponse with Trailers.
Added MetadataBuilder to javadsl and scaladsl. Refactored MetadataImpl to reduce code duplication. Added metadata unit tests.
- Loading branch information
1 parent
ec63629
commit aafd784
Showing
22 changed files
with
738 additions
and
250 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright (C) 2018-2020 Lightbend Inc. <https://www.lightbend.com> | ||
*/ | ||
|
||
package akka.grpc | ||
|
||
import io.grpc.Status | ||
import akka.grpc.internal.JavaMetadataImpl | ||
import akka.grpc.scaladsl.{ Metadata, MetadataBuilder } | ||
import akka.grpc.javadsl.{ Metadata => jMetadata } | ||
|
||
case class Trailers(status: Status, metadata: Metadata) { | ||
def this(status: Status) { | ||
this(status, MetadataBuilder.empty) | ||
} | ||
|
||
def this(status: Status, metadata: jMetadata) { | ||
this(status, metadata.asScala) | ||
} | ||
|
||
/** | ||
* Java API: Returns the status. | ||
*/ | ||
def getStatus: Status = | ||
status | ||
|
||
/** | ||
* Java API: Returns the trailing metadata. | ||
*/ | ||
def getMetadata: jMetadata = | ||
new JavaMetadataImpl(metadata) | ||
} | ||
|
||
object Trailers { | ||
def apply(status: Status): Trailers = new Trailers(status) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.