client

package
v0.0.0-...-89a784c Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: LGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client represents a swap RPC client, used to interact with a swap daemon via JSON-RPC calls.

func NewClient

func NewClient(endpoint string) *Client

NewClient ...

func (*Client) ID

func (c *Client) ID(hostIndex int) (peer.ID, error)

func (*Client) Lookup

func (c *Client) Lookup(hostIndex int, target cid.Cid, prefixLength int) ([]peer.AddrInfo, error)

func (*Client) NumHosts

func (c *Client) NumHosts() (int, error)

func (*Client) Provide

func (c *Client) Provide(hostIndex int, cids []cid.Cid) error

type IDRequest

type IDRequest struct {
	HostIndex int `json:"hostIndex"`
}

type IDResponse

type IDResponse struct {
	PeerID peer.ID `json:"peerID"`
}

type LookupRequest

type LookupRequest struct {
	HostIndex    int     `json:"hostIndex"`
	Target       cid.Cid `json:"cid"`
	PrefixLength int     `json:"prefixLength"`
}

type LookupResponse

type LookupResponse struct {
	Providers []peer.AddrInfo `json:"providers"`
}

type NumHostsResponse

type NumHostsResponse struct {
	NumHosts int `json:"numHosts"`
}

type ProvideRequest

type ProvideRequest struct {
	HostIndex int       `json:"hostIndex"`
	CIDs      []cid.Cid `json:"cids"`
}

Jump to

Keyboard shortcuts

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