Documentation ¶
Overview ¶
Package client - contains the client code.
Index ¶
- type FilecoinRetrievalClient
- func (c *FilecoinRetrievalClient) AddActivePeer(targetID string) error
- func (c *FilecoinRetrievalClient) BlockPeer(targetID string)
- func (c *FilecoinRetrievalClient) DHTDiscovery(cidStr string, targetID string) ([]cidoffer.SubCIDOffer, error)
- func (c *FilecoinRetrievalClient) FastRetrieve(cidStr string, location string, maxPrice *big.Int) error
- func (c *FilecoinRetrievalClient) GetPeerHistory(targetID string, from uint, to uint) []string
- func (c *FilecoinRetrievalClient) GetPeerReputaion(peerID string) (int64, bool, bool, error)
- func (c *FilecoinRetrievalClient) ListActivePeers() []string
- func (c *FilecoinRetrievalClient) ListOffers(cidStr string) ([]cidoffer.SubCIDOffer, error)
- func (c *FilecoinRetrievalClient) ResumePeer(targetID string)
- func (c *FilecoinRetrievalClient) Retrieve(digest string, location string) error
- func (c *FilecoinRetrievalClient) Search(location string) ([]string, error)
- func (c *FilecoinRetrievalClient) Shutdown()
- func (c *FilecoinRetrievalClient) StandardDiscovery(cidStr string) ([]cidoffer.SubCIDOffer, error)
- func (c *FilecoinRetrievalClient) UnblockPeer(targetID string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FilecoinRetrievalClient ¶
type FilecoinRetrievalClient struct {
// contains filtered or unexported fields
}
FilecoinRetrievalClient is an example implementation using the api, which holds information about the interaction of the Filecoin Retrieval Client with Filecoin Retrieval Gateways/Providers.
func NewFilecoinRetrievalClient ¶
func NewFilecoinRetrievalClient( walletPrivKey string, lotusAPIAddr string, lotusAuthToken string, registerPrivKey string, registerAPIAddr string, registerAuthToken string, ) (*FilecoinRetrievalClient, error)
NewFilecoinRetrievalClient initialise the Filecoin Retrieval Client.
func (*FilecoinRetrievalClient) AddActivePeer ¶
func (c *FilecoinRetrievalClient) AddActivePeer(targetID string) error
AddActivePeer adds an active peer by its ID
func (*FilecoinRetrievalClient) BlockPeer ¶
func (c *FilecoinRetrievalClient) BlockPeer(targetID string)
BlockPeer blocks a peer
func (*FilecoinRetrievalClient) DHTDiscovery ¶
func (c *FilecoinRetrievalClient) DHTDiscovery(cidStr string, targetID string) ([]cidoffer.SubCIDOffer, error)
DHTDiscovery performs a DHT discovery.
func (*FilecoinRetrievalClient) FastRetrieve ¶
func (*FilecoinRetrievalClient) GetPeerHistory ¶
func (c *FilecoinRetrievalClient) GetPeerHistory(targetID string, from uint, to uint) []string
GetPeerRecentHistory gets the most recent history of a target peer ID.
func (*FilecoinRetrievalClient) GetPeerReputaion ¶
GetPeerReputaion gets the reputation of a target peer ID.
func (*FilecoinRetrievalClient) ListActivePeers ¶
func (c *FilecoinRetrievalClient) ListActivePeers() []string
ListActivePeers lists all active peers
func (*FilecoinRetrievalClient) ListOffers ¶
func (c *FilecoinRetrievalClient) ListOffers(cidStr string) ([]cidoffer.SubCIDOffer, error)
ListOffers lists offers by given cid
func (*FilecoinRetrievalClient) ResumePeer ¶
func (c *FilecoinRetrievalClient) ResumePeer(targetID string)
ResumePeer resumes a peer
func (*FilecoinRetrievalClient) Retrieve ¶
func (c *FilecoinRetrievalClient) Retrieve(digest string, location string) error
Retrieve retrieves a file to a given location
func (*FilecoinRetrievalClient) Search ¶
func (c *FilecoinRetrievalClient) Search(location string) ([]string, error)
Search searches gateways that are in given location.
func (*FilecoinRetrievalClient) Shutdown ¶
func (c *FilecoinRetrievalClient) Shutdown()
Shutdown shuts down the client's routine.
func (*FilecoinRetrievalClient) StandardDiscovery ¶
func (c *FilecoinRetrievalClient) StandardDiscovery(cidStr string) ([]cidoffer.SubCIDOffer, error)
StandardDiscovery performs a standard discovery.
func (*FilecoinRetrievalClient) UnblockPeer ¶
func (c *FilecoinRetrievalClient) UnblockPeer(targetID string)
UnblockPeer unblocks a peer