Documentation
¶
Index ¶
- Variables
- func ReadGRPCMessage(body io.Reader, msg []byte) (int, error)
- func ReadGRPCMessageWithEncoding(body io.Reader, msg []byte, encoding string) (int, error)
- func WriteGRPCMessage(w io.Writer, msg []byte) error
- func WriteGRPCMessageCompressed(w io.Writer, msg []byte, encoding string) error
- func WriteGRPCMessageGzip(w io.Writer, msg []byte) error
- type UnsupportedCompressionError
Constants ¶
This section is empty.
Variables ¶
var ErrMissingCompressionEncoding = errors.New("compressed message missing grpc-encoding")
Functions ¶
func ReadGRPCMessage ¶ added in v0.1.0
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
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 ¶
WriteGRPCMessage writes an uncompressed gRPC length-prefixed message.
func WriteGRPCMessageCompressed ¶ added in v0.23.0
WriteGRPCMessageCompressed writes a 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
func (e *UnsupportedCompressionError) Error() string