Class GrpcTrailersUtil
java.lang.Object
com.linecorp.armeria.common.grpc.protocol.GrpcTrailersUtil
@UnstableApi public final class GrpcTrailersUtil extends Object
Utility for creating response trailers for a gRPC status. Trailers are only returned from a server.
-
Method Summary
Modifier and Type Method Description static HttpHeadersBuilder
statusToTrailers(int code, String message, boolean headersSent)
Converts the given gRPC status code, and optionally an error message, to headers.
-
Method Details
-
statusToTrailers
public static HttpHeadersBuilder statusToTrailers(int code, @Nullable String message, boolean headersSent)Converts the given gRPC status code, and optionally an error message, to headers. The headers will be either trailers-only or normal trailers based onheadersSent
, whether leading headers have already been sent to the client.
-