stdio

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Transport

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

Transport is a Transport implementation that reads from an io.ReadCloser and writes to an io.WriteCloser using the jsonrpc2 library.

func NewTransport

func NewTransport(stdin io.ReadCloser, stdout io.WriteCloser) *Transport

NewTransport constructs a transport from a read/write pair (usually pipes).

func (*Transport) Close

func (t *Transport) Close() error

Close closes the connection and signals done, but also waits for the goroutine.

func (*Transport) Done

func (t *Transport) Done() <-chan struct{}

Done is closed once this transport is fully closed

func (*Transport) GetRouter

func (t *Transport) GetRouter() *transport.MessageRouter

GetRouter returns this transport's MessageRouter

func (*Transport) Logf

func (t *Transport) Logf(format string, args ...interface{})

Logf logs if we have a logger

func (*Transport) Send

func (t *Transport) Send(ctx context.Context, msg *types.Message) error

Send sends a single JSON-RPC message. If it’s a request, we wait for a response.

func (*Transport) SetLogger

func (t *Transport) SetLogger(l logger.Logger)

SetLogger sets the logger for debug printing

func (*Transport) Start

func (t *Transport) Start(ctx context.Context) error

Start kicks off the jsonrpc2 listener in a background goroutine.

Jump to

Keyboard shortcuts

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