rpc

package
v0.0.0-...-4cbcc9d Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: MIT Imports: 5 Imported by: ? modules, 0 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

func StartServer

func StartServer(addr string, codec jsonrpc2.ObjectCodec, h jsonrpc2.Handler) error

Types

type Client

type Client struct {
	*jsonrpc2.Conn
}

func (*Client) Call

func (c *Client) Call(method string, payload any, result any) error

func (*Client) Handle

func (c *Client) Handle(ctx context.Context, conn *jsonrpc2.Conn, req *jsonrpc2.Request)

func (*Client) Notify

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

type CustomStream

type CustomStream struct {
	io.ReadCloser
	io.WriteCloser
}

func (*CustomStream) Close

func (conn *CustomStream) Close() error

func (*CustomStream) Read

func (conn *CustomStream) Read(p []byte) (n int, err error)

func (*CustomStream) Write

func (conn *CustomStream) Write(p []byte) (n int, err error)

type HandlerFunc

type HandlerFunc func(context.Context, *jsonrpc2.Conn, *jsonrpc2.Request)

func (HandlerFunc) Handle

func (h HandlerFunc) Handle(ctx context.Context, c *jsonrpc2.Conn, r *jsonrpc2.Request)

Jump to

Keyboard shortcuts

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