client

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: BSD-3-Clause Imports: 16 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NumConnectTries   int           = 3
	NumStreamers      int           = 3
	DiscoveryLimit    int           = 1024
	SendToPeerTimeout time.Duration = 10 * time.Second

	MaxStreamsPerSend = 16
)

Functions

This section is empty.

Types

type Client

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

func New

func New(node peer.Node, path string) (*Client, error)

func (*Client) Close

func (c *Client) Close()

func (*Client) Context

func (c *Client) Context() context.Context

func (*Client) New added in v0.10.0

func (c *Client) New(cmd string, opts ...Option) *Request

func (*Client) Send

func (c *Client) Send(cmd string, body command.Body) (cr.Response, error)

func (*Client) SendTo

func (c *Client) SendTo(pid peerCore.ID, cmd string, body command.Body) (cr.Response, error)

func (*Client) SendToWithTimeout added in v0.10.1

func (c *Client) SendToWithTimeout(pid peerCore.ID, cmd string, body command.Body, timeout time.Duration) (cr.Response, error)

func (*Client) SendWithTimeout added in v0.10.1

func (c *Client) SendWithTimeout(cmd string, body command.Body, timeout time.Duration) (cr.Response, error)

type Option added in v0.10.0

type Option func(r *Request) error

func Body added in v0.10.0

func Body(body command.Body) Option

func Threshold added in v0.10.0

func Threshold(threshold int) Option

func Timeout added in v0.10.0

func Timeout(timeout time.Duration) Option

func To added in v0.10.0

func To(peers ...peerCore.ID) Option

type Request added in v0.10.0

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

func (*Request) Do added in v0.10.0

func (r *Request) Do() (<-chan *Response, error)

type Response added in v0.10.0

type Response struct {
	io.ReadWriter

	cr.Response
	// contains filtered or unexported fields
}

func (*Response) Close added in v0.10.0

func (r *Response) Close()

func (*Response) CloseRead added in v0.11.1

func (r *Response) CloseRead()

func (*Response) CloseWrite added in v0.11.1

func (r *Response) CloseWrite()

func (*Response) Error added in v0.10.1

func (r *Response) Error() error

func (*Response) PID added in v0.10.0

func (r *Response) PID() peerCore.ID

Jump to

Keyboard shortcuts

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