client

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2023 License: BSD-3-Clause Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NumConnectTries        int           = 3
	NumStreamers           int           = 3
	DiscoveryLimit         int           = 1024
	SendTimeout            time.Duration = 3 * time.Second
	RecvTimeout            time.Duration = 3 * time.Second
	EstablishStreamTimeout time.Duration = 5 * time.Second
	SendToPeerTimeout      time.Duration = 10 * time.Second
)

Functions

This section is empty.

Types

type Client

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

func New

func New(ctx context.Context, node *peer.Node, peers []string, path string, min int, max int) (*Client, error)

func (*Client) Close

func (c *Client) Close()

func (*Client) Context

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

func (*Client) Send

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

func (*Client) SendForPid

func (c *Client) SendForPid(cmdName string, body command.Body) (peerCore.ID, cr.Response, error)

func (*Client) SendTo

func (c *Client) SendTo(cid cid.Cid, cmdName string, body command.Body) (cr.Response, error)

func (*Client) TrySend

func (c *Client) TrySend(cmdName string, body command.Body) (cr.Response, error)

this command will only fail with a timeout error or out of peers

Jump to

Keyboard shortcuts

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