stdio

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2026 License: Apache-2.0 Imports: 13 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client represent a base

func New

func New(command string, options ...Option) (*Client, error)

func (*Client) Notify

func (c *Client) Notify(ctx context.Context, request *jsonrpc.Notification) error

func (*Client) Send

func (c *Client) Send(ctx context.Context, request *jsonrpc.Request) (*jsonrpc.Response, error)

type Option

type Option func(c *Client)

func WithArguments

func WithArguments(args ...string) Option

WithArguments is used to set the command line arguments for the base

func WithEnvironment

func WithEnvironment(key, value string) Option

WithEnvironment is used to set the environment for the base

func WithHandler

func WithHandler(handler transport.Handler) Option

func WithInterceptor added in v0.3.0

func WithInterceptor(interceptor transport.Interceptor) Option

WithInterceptor sets a custom interceptor for the client

func WithListener

func WithListener(listener jsonrpc.Listener) Option

WithListener set listener on stdio base

func WithLogger

func WithLogger(logger jsonrpc.Logger) Option

func WithRunTimeout

func WithRunTimeout(timeoutMs int) Option

func WithSecret

func WithSecret(resource secret.Resource) Option

WithSecret allows to inject a secret resource into the base

func WithTrips

func WithTrips(trips *transport.RoundTrips) Option

WithTrips with trips

type Transport

type Transport struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*Transport) SendData

func (c *Transport) SendData(ctx context.Context, data []byte) error

SendData sends data to the Transport

Jump to

Keyboard shortcuts

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