gotools/internal/jsonrpc2/stream.go

type Stream

type Framer

// NewRawStream returns a Stream built on top of a net.Conn.
// The messages are sent with no wrapping, and rely on json decode consistency
// to determine message boundaries.
func NewRawStream(conn net.Conn) Stream {}

type rawStream

func (s *rawStream) Read(ctx context.Context) (Message, int64, error) {}

func (s *rawStream) Write(ctx context.Context, msg Message) (int64, error) {}

func (s *rawStream) Close() error {}

// NewHeaderStream returns a Stream built on top of a net.Conn.
// The messages are sent with HTTP content length and MIME type headers.
// This is the format used by LSP and others.
func NewHeaderStream(conn net.Conn) Stream {}

type headerStream

func (s *headerStream) Read(ctx context.Context) (Message, int64, error) {}

func (s *headerStream) Write(ctx context.Context, msg Message) (int64, error) {}

func (s *headerStream) Close() error {}