grpc

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusCodeOk                 = "0"
	StatusCodeCancelled          = "1"
	StatusCodeUnknown            = "2"
	StatusCodeInvalidArgument    = "3"
	StatusCodeDeadlineExceeded   = "4"
	StatusCodeNotFound           = "5"
	StatusCodeAlreadyExist       = "6"
	StatusCodePermissionDenied   = "7"
	StatusCodeResourceExhausted  = "8"
	StatusCodeFailedPrecondition = "9"
	StatusCodeAbort              = "10"
	StatusCodeOutOfRange         = "11"
	StatusCodeUnimplemented      = "12"
	StatusCodeInternal           = "13"
	StatusCodeUnavailable        = "14"
	StatusCodeDataLoss           = "15"
	StatusCodeUnauthenticated    = "16"
)

https://github.com/grpc/grpc/blob/master/doc/statuscodes.md

Variables

This section is empty.

Functions

func CheckDataFrame

func CheckDataFrame(req []byte) error

CheckDataFrame verify the `Compressed-Flag` and `Message-Length` in DATA frame. See https://grpc.github.io/grpc/core/md_doc__p_r_o_t_o_c_o_l-_h_t_t_p2.html

The DATA frame looks like: +------------+---------------------------------------------+ | 1 byte | 4 bytes | +------------+---------------------------------------------+ | Compressed | Message Length | | Flag | (uint32) | +------------+---------------------------------------------+ | | | Message Data | | (variable length) | | | +----------------------------------------------------------+

func WriteErrorGrpcResponse

func WriteErrorGrpcResponse(w http.ResponseWriter, grpcErrorCode, grpcErrorMessage string)

WriteErrorGrpcResponse write error response in gRPC protocol over HTTP.

Types

This section is empty.

Jump to

Keyboard shortcuts

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