grpc

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMissingCompressionEncoding = errors.New("compressed message missing grpc-encoding")

Functions

func ReadGRPCMessage added in v0.1.0

func ReadGRPCMessage(body io.Reader, msg []byte) (int, error)

ReadGRPCMessage reads a gRPC length-prefixed message from body into msg. If the compression flag is set to 1 (gzip), the payload is decompressed transparently before being written into msg.

func ReadGRPCMessageWithEncoding added in v0.23.0

func ReadGRPCMessageWithEncoding(body io.Reader, msg []byte, encoding string) (int, error)

ReadGRPCMessageWithEncoding reads a gRPC length-prefixed message from body into msg. If the compression flag is set to 1, the payload is decompressed using encoding. The gRPC "deflate" encoding is the zlib structure from RFC 1950 carrying the deflate algorithm from RFC 1951, never raw deflate data.

func WriteGRPCMessage

func WriteGRPCMessage(w io.Writer, msg []byte) error

WriteGRPCMessage writes an uncompressed gRPC length-prefixed message.

func WriteGRPCMessageCompressed added in v0.23.0

func WriteGRPCMessageCompressed(w io.Writer, msg []byte, encoding string) error

WriteGRPCMessageCompressed writes a compressed gRPC length-prefixed message. The compression flag byte is set to 1.

func WriteGRPCMessageGzip added in v0.23.0

func WriteGRPCMessageGzip(w io.Writer, msg []byte) error

WriteGRPCMessageGzip writes a gzip-compressed gRPC length-prefixed message. The compression flag byte is set to 1.

Types

type UnsupportedCompressionError added in v0.23.0

type UnsupportedCompressionError struct {
	Encoding string
}

func (*UnsupportedCompressionError) Error added in v0.23.0

Jump to

Keyboard shortcuts

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