stdio

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2025 License: Apache-2.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

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

Logger provides simple logging functionality

func NewLogger

func NewLogger(writerOrLogger interface{}) *Logger

NewLogger creates a new Logger with the specified writer or logger

func (*Logger) Errorf

func (l *Logger) Errorf(format string, args ...interface{})

Errorf implements jsonrpc.Logger interface

func (*Logger) WriteString

func (l *Logger) WriteString(msg string)

WriteString writes a string to the logger

type Option

type Option func(*Server)

Option represents a functional option for configuring the stdio transport

func WithErrorWriter

func WithErrorWriter(writer io.Writer) Option

WithErrorWriter sets the error output writer

func WithLogger

func WithLogger(logger *Logger) Option

WithLogger sets the logger

func WithReader

func WithReader(reader io.ReadCloser) Option

WithReader sets the input reader

type Server

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

Server represents a server that handles incoming requests and responses

func New

func New(ctx context.Context, newHandler transport.NewHandler, options ...Option) *Server

New creates a new stdio transport instance with the provided handler and options

func (*Server) ListenAndServe

func (t *Server) ListenAndServe() error

type Writer

type Writer struct {
	io.Writer
}

Writer is a simple wrapper around io.Writer to implement the jsonrpc transport interface

func NewWriter

func NewWriter(writer io.Writer) *Writer

NewWriter creates a new Writer instance

func (*Writer) Write

func (w *Writer) Write(p []byte) (n int, err error)

Write implements the io.Writer interface for Writer

Jump to

Keyboard shortcuts

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