status

package
v1.5.4 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 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 FromGRPCCode

func FromGRPCCode(code gcodes.Code) int

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

func ToGRPCCode

func ToGRPCCode(code int) gcodes.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) gcodes.Code

	// FromGRPCCode converts a gRPC error code into the corresponding HTTP response status.
	FromGRPCCode(code gcodes.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