Help us shape the future of Go! Take the 2026 Go Developer Survey

framedstream

package
v0.57.21 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MaxMessageSize uint32 = 10 * 1024 * 1024 // 10MB

MaxMessageSize is the max message size in bytes.

Functions

This section is empty.

Types

type Stream

type Stream struct {
	// contains filtered or unexported fields
}

Stream wraps an io.ReadWriteCloser to implement rpcstream.RpcStream. Uses LittleEndian uint32 length-prefix framing for messages.

func New

func New(ctx context.Context, rwc io.ReadWriteCloser) *Stream

New creates a new framed Stream.

func (*Stream) Close

func (s *Stream) Close() error

Close closes the stream.

func (*Stream) CloseSend

func (s *Stream) CloseSend() error

CloseSend signals to the remote that we will no longer send any messages.

func (*Stream) Context

func (s *Stream) Context() context.Context

Context returns the stream context.

func (*Stream) MsgRecv

func (s *Stream) MsgRecv(msg srpc.Message) error

MsgRecv receives a protobuf message from the remote.

func (*Stream) MsgSend

func (s *Stream) MsgSend(msg srpc.Message) error

MsgSend sends a protobuf message to the remote.

func (*Stream) Recv

func (s *Stream) Recv() (*rpcstream.RpcStreamPacket, error)

Recv receives an RpcStreamPacket.

func (*Stream) RecvRaw

func (s *Stream) RecvRaw() ([]byte, error)

RecvRaw reads a length-prefixed frame and returns the raw bytes.

func (*Stream) Send

func (s *Stream) Send(pkt *rpcstream.RpcStreamPacket) error

Send sends an RpcStreamPacket.

func (*Stream) SendRaw

func (s *Stream) SendRaw(data []byte) error

SendRaw writes raw bytes with length-prefix framing.

Jump to

Keyboard shortcuts

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