status

package
v1.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2022 License: MIT Imports: 2 Imported by: 0

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

func GRPCCodeFromStatus(code int) codes.Code

GRPCCodeFromStatus converts a HTTP error code into the corresponding gRPC response status.

func HTTPStatusFromCode

func HTTPStatusFromCode(code codes.Code) int

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL