rpc

package
v0.0.0-...-7b7b160 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: MIT Imports: 5 Imported by: 0

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