stdio

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2025 License: MIT Imports: 9 Imported by: 24

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StdioServerTransport

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

StdioServerTransport implements server-side transport for stdio communication

func NewStdioServerTransport

func NewStdioServerTransport() *StdioServerTransport

NewStdioServerTransport creates a new StdioServerTransport using os.Stdin and os.Stdout

func NewStdioServerTransportWithIO

func NewStdioServerTransportWithIO(in io.Reader, out io.Writer) *StdioServerTransport

NewStdioServerTransportWithIO creates a new StdioServerTransport with custom io.Reader and io.Writer

func (*StdioServerTransport) Close

func (t *StdioServerTransport) Close() error

Close stops the transport and cleans up resources

func (*StdioServerTransport) Send

Send sends a JSON-RPC message

func (*StdioServerTransport) SetCloseHandler

func (t *StdioServerTransport) SetCloseHandler(handler func())

SetCloseHandler sets the handler for close events

func (*StdioServerTransport) SetErrorHandler

func (t *StdioServerTransport) SetErrorHandler(handler func(error))

SetErrorHandler sets the handler for error events

func (*StdioServerTransport) SetMessageHandler

func (t *StdioServerTransport) SetMessageHandler(handler func(ctx context.Context, message *transport.BaseJsonRpcMessage))

SetMessageHandler sets the handler for incoming messages

func (*StdioServerTransport) Start

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

Start begins listening for messages on stdin

Directories

Path Synopsis
internal
stdio
This file implements the stdio transport layer for JSON-RPC communication.
This file implements the stdio transport layer for JSON-RPC communication.

Jump to

Keyboard shortcuts

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