Documentation
¶
Overview ¶
Package clientapi - a collection of Retrieval Client requests methods used to call FileCoin Secondary Retrieval network. These functions are playing a role of intermediate facade to call the FileCoin Secondary Retrieval network and hiding away network transport details
Index ¶
- type Client
- func (c *Client) RequestDHTDiscover(gatewayRegistrar register.GatewayRegistrar, contentID *cid.ContentID, ...) ([]nodeid.NodeID, []fcrmessages.FCRMessage, []nodeid.NodeID, error)
- func (c *Client) RequestDHTDiscoverV2(gatewayRegistrar register.GatewayRegistrar, contentID *cid.ContentID, ...) ([]nodeid.NodeID, []fcrmessages.FCRMessage, []nodeid.NodeID, error)
- func (c *Client) RequestDHTOfferAck(gatewayRegistrar register.ProviderRegistrar, contentID *cid.ContentID, ...) (bool, *fcrmessages.FCRMessage, *fcrmessages.FCRMessage, error)
- func (c *Client) RequestDHTOfferDiscover(gatewayRegistrar register.GatewayRegistrar, gatewayIDs []nodeid.NodeID, ...) ([]GatewaySubOffers, error)
- func (c *Client) RequestEstablishment(gatewayRegistrar register.GatewayRegistrar, challenge []byte, ...) error
- func (c *Client) RequestStandardDiscover(gatewayRegistrar register.GatewayRegistrar, contentID *cid.ContentID, ...) ([]cidoffer.SubCIDOffer, error)
- func (c *Client) RequestStandardDiscoverOffer(gatewayRegistrar register.GatewayRegistrar, contentID *cid.ContentID, ...) ([]cidoffer.SubCIDOffer, error)
- func (c *Client) RequestStandardDiscoverV2(gatewayRegistrar register.GatewayRegistrar, contentID *cid.ContentID, ...) ([][cidoffer.CIDOfferDigestSize]byte, error)
- type ClientApi
- type GatewaySubOffers
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
}
func (*Client) RequestDHTDiscover ¶
func (c *Client) RequestDHTDiscover( gatewayRegistrar register.GatewayRegistrar, contentID *cid.ContentID, nonce int64, ttl int64, numDHT int64, incrementalResult bool, paychAddr string, voucher string, ) ([]nodeid.NodeID, []fcrmessages.FCRMessage, []nodeid.NodeID, error)
RequestDHTDiscover requests a dht discover to a given gateway for a given contentID, nonce and ttl.
func (*Client) RequestDHTDiscoverV2 ¶
func (c *Client) RequestDHTDiscoverV2( gatewayRegistrar register.GatewayRegistrar, contentID *cid.ContentID, nonce int64, ttl int64, numDHT int64, incrementalResult bool, paychAddr string, voucher string, ) ([]nodeid.NodeID, []fcrmessages.FCRMessage, []nodeid.NodeID, error)
RequestDHTDiscoverV2 requests a dht discover to a given gateway for a given contentID, nonce and ttl.
func (*Client) RequestDHTOfferAck ¶
func (c *Client) RequestDHTOfferAck( gatewayRegistrar register.ProviderRegistrar, contentID *cid.ContentID, gatewayID *nodeid.NodeID, ) (bool, *fcrmessages.FCRMessage, *fcrmessages.FCRMessage, error)
RequestDHTOfferAck requests a dht offer ack to a given provider for a pair of cid and gateway id
func (*Client) RequestDHTOfferDiscover ¶
func (c *Client) RequestDHTOfferDiscover( gatewayRegistrar register.GatewayRegistrar, gatewayIDs []nodeid.NodeID, contentID *cid.ContentID, nonce int64, offersDigests [][][cidoffer.CIDOfferDigestSize]byte, paymentChannelAddr string, voucher string, ) ([]GatewaySubOffers, error)
func (*Client) RequestEstablishment ¶
func (c *Client) RequestEstablishment( gatewayRegistrar register.GatewayRegistrar, challenge []byte, clientID *nodeid.NodeID, ttl int64, ) error
RequestEstablishment requests an establishment to a given gateway for a given challenge, client id and ttl.
func (*Client) RequestStandardDiscover ¶
func (c *Client) RequestStandardDiscover( gatewayRegistrar register.GatewayRegistrar, contentID *cid.ContentID, nonce int64, ttl int64, paychAddr string, voucher string, ) ([]cidoffer.SubCIDOffer, error)
RequestStandardDiscover requests a standard discover to a given gateway for a given contentID, nonce and ttl.
func (*Client) RequestStandardDiscoverOffer ¶
func (c *Client) RequestStandardDiscoverOffer( gatewayRegistrar register.GatewayRegistrar, contentID *cid.ContentID, nonce int64, ttl int64, offerDigests [][cidoffer.CIDOfferDigestSize]byte, paychAddr string, voucher string, ) ([]cidoffer.SubCIDOffer, error)
RequestStandardDiscoverOffer requests a standard discover to a given gateway for a given contentID, nonce and ttl.
func (*Client) RequestStandardDiscoverV2 ¶
func (c *Client) RequestStandardDiscoverV2( gatewayRegistrar register.GatewayRegistrar, contentID *cid.ContentID, nonce int64, ttl int64, paychAddr string, voucher string, ) ([][cidoffer.CIDOfferDigestSize]byte, error)
RequestStandardDiscoverV2 requests a standard discover to a given gateway for a given contentID, nonce and ttl.
type ClientApi ¶
type ClientApi interface {
RequestDHTOfferDiscover(
gatewayInfo register.GatewayRegistrar,
gatewayIDs []nodeid.NodeID,
contentID *cid.ContentID,
nonce int64,
offersDigests [][][cidoffer.CIDOfferDigestSize]byte,
paymentChannelAddr string,
voucher string,
) ([]GatewaySubOffers, error)
RequestDHTDiscover(
gatewayInfo register.GatewayRegistrar,
contentID *cid.ContentID,
nonce int64,
ttl int64,
numDHT int64,
incrementalResult bool,
paychAddr string,
voucher string,
) ([]nodeid.NodeID, []fcrmessages.FCRMessage, []nodeid.NodeID, error)
RequestDHTDiscoverV2(
gatewayInfo register.GatewayRegistrar,
contentID *cid.ContentID,
nonce int64,
ttl int64,
numDHT int64,
incrementalResult bool,
paychAddr string,
voucher string,
) ([]nodeid.NodeID, []fcrmessages.FCRMessage, []nodeid.NodeID, error)
RequestDHTOfferAck(
providerInfo register.ProviderRegistrar,
contentID *cid.ContentID,
gatewayID *nodeid.NodeID,
) (bool, *fcrmessages.FCRMessage, *fcrmessages.FCRMessage, error)
RequestEstablishment(
gatewayInfo register.GatewayRegistrar,
challenge []byte,
clientID *nodeid.NodeID,
ttl int64,
) error
RequestStandardDiscoverOffer(
gatewayInfo register.GatewayRegistrar,
contentID *cid.ContentID,
nonce int64,
ttl int64,
offerDigests [][cidoffer.CIDOfferDigestSize]byte,
paychAddr string,
voucher string,
) ([]cidoffer.SubCIDOffer, error)
RequestStandardDiscover(
gatewayInfo register.GatewayRegistrar,
contentID *cid.ContentID,
nonce int64,
ttl int64,
paychAddr string,
voucher string,
) ([]cidoffer.SubCIDOffer, error)
RequestStandardDiscoverV2(
gatewayInfo register.GatewayRegistrar,
contentID *cid.ContentID,
nonce int64,
ttl int64,
paychAddr string,
voucher string,
) ([][cidoffer.CIDOfferDigestSize]byte, error)
}
func NewAdminApiWithDep ¶
func NewAdminApiWithDep(httpCommunicator request.HttpCommunications) ClientApi
func NewClientApi ¶
func NewClientApi() ClientApi
type GatewaySubOffers ¶
type GatewaySubOffers struct {
GatewayID *nodeid.NodeID `json:"gateway_id"`
SubOffers []cidoffer.SubCIDOffer `json:"sub_cid_offers"`
}
GatewaySubOffers - relation between a Gateway and the Sub-Offers received through the Gateway