status

package
v2.5.1 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2022 License: MIT Imports: 2 Imported by: 21

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 FromGRPCCode

func FromGRPCCode(code codes.Code) int

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

func ToGRPCCode

func ToGRPCCode(code int) codes.Code

ToGRPCCode converts an HTTP error code into the corresponding gRPC response status.

Types

type Converter

type Converter interface {
	// ToGRPCCode converts an HTTP error code into the corresponding gRPC response status.
	ToGRPCCode(code int) codes.Code

	// FromGRPCCode converts a gRPC error code into the corresponding HTTP response status.
	FromGRPCCode(code codes.Code) int
}

Converter is a status converter.

var DefaultConverter Converter = statusConverter{}

DefaultConverter default converter.

Jump to

Keyboard shortcuts

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