Documentation ¶
Index ¶
Constants ¶
View Source
const ( // ClientClosed is non-standard http status code, which defined by nginx. // https://httpstatus.in/499/ ClientClosed = 499 )
Variables ¶
This section is empty.
Functions ¶
func GRPCCodeFromStatus ¶
GRPCCodeFromStatus converts a HTTP error code into the corresponding gRPC response status.
func HTTPStatusFromCode ¶
HTTPStatusFromCode converts a gRPC error code into the corresponding HTTP response status.
Types ¶
type Converter ¶
type Converter interface { // GRPCCodeFromStatus converts a HTTP error code into the corresponding gRPC response status. GRPCCodeFromStatus(code int) codes.Code // HTTPStatusFromCode converts a gRPC error code into the corresponding HTTP response status. HTTPStatusFromCode(code codes.Code) int }
Converter is a status converter.
var DefaultConverter Converter = &statusConverter{}
DefaultConverter is the default status converter.
Click to show internal directories.
Click to hide internal directories.