jsonrpc

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadMessage

func ReadMessage(r *bufio.Reader) ([]byte, error)

func WriteMessage

func WriteMessage(w io.Writer, body []byte) error

Types

type Client

type Client struct {
	OnNotify func(method string, params json.RawMessage)
	// contains filtered or unexported fields
}

func NewClient

func NewClient(stdin io.WriteCloser, stdout io.Reader, stderr io.Reader, onNotify func(string, json.RawMessage)) *Client

func (*Client) Call

func (c *Client) Call(ctx context.Context, method string, params any) (json.RawMessage, error)

func (*Client) Close

func (c *Client) Close()

func (*Client) IsClosed

func (c *Client) IsClosed() bool

func (*Client) Notify

func (c *Client) Notify(method string, params any) error

func (*Client) Start

func (c *Client) Start()

type ResponseError

type ResponseError struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

func (*ResponseError) Error

func (e *ResponseError) Error() string

Jump to

Keyboard shortcuts

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