inproc

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2023 License: Unlicense Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ServerMaker

func ServerMaker() (*server.Server, jrpctest.ClientMaker, func())

Types

type Client

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

func NewClient

func NewClient(c *Codec, handler codec.Handler) *Client

func (*Client) BatchCall

func (c *Client) BatchCall(ctx context.Context, b ...*codec.BatchElem) error

func (*Client) Close

func (c *Client) Close() error

func (*Client) Closed

func (c *Client) Closed() <-chan struct{}

func (*Client) Do

func (c *Client) Do(ctx context.Context, result any, method string, params any) error

func (*Client) Mount

func (c *Client) Mount(h codec.Middleware)

func (*Client) Notify

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

func (*Client) SetHeader

func (c *Client) SetHeader(key string, value string)

type Codec

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

func NewCodec

func NewCodec() *Codec

func (*Codec) Close

func (c *Codec) Close() error

closes the connection

func (*Codec) Closed

func (c *Codec) Closed() <-chan struct{}

Closed returns a channel which is closed when the connection is closed.

func (*Codec) PeerInfo

func (c *Codec) PeerInfo() codec.PeerInfo

gets the peer info

func (*Codec) ReadBatch

func (c *Codec) ReadBatch(ctx context.Context) ([]*codec.Message, bool, error)

func (*Codec) RemoteAddr

func (c *Codec) RemoteAddr() string

RemoteAddr returns the peer address of the connection.

func (*Codec) Send added in v0.3.1

func (c *Codec) Send(ctx context.Context, msg json.RawMessage) (err error)

Jump to

Keyboard shortcuts

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