stdio

package
v0.25.1 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 9 Imported by: 2 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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