Documentation ¶
Overview ¶
Package fcroffermgr - is dedicated for operations on FileCoin Retrieval Offers, including DHT (Distributed Hash Table structure) Offers and Group Offers.
Offer is an agreement from a Storage Provider to deliver a file from their storage to a client.
Index ¶
- type FCROfferMgr
- func (mgr *FCROfferMgr) AddDHTOffer(offer *cidoffer.CIDOffer) error
- func (mgr *FCROfferMgr) AddGroupOffer(offer *cidoffer.CIDOffer) error
- func (mgr *FCROfferMgr) GetDHTOffers(cid *cid.ContentID) ([]cidoffer.CIDOffer, bool)
- func (mgr *FCROfferMgr) GetDHTOffersWithinRange(cidMin, cidMax *cid.ContentID, maxOffers int) ([]cidoffer.CIDOffer, bool)
- func (mgr *FCROfferMgr) GetGroupOffers(cid *cid.ContentID) ([]cidoffer.CIDOffer, bool)
- func (mgr *FCROfferMgr) GetOfferByDigest(digest [cidoffer.CIDOfferDigestSize]byte) (result *cidoffer.CIDOffer, exist bool)
- func (mgr *FCROfferMgr) GetOffers(cid *cid.ContentID) ([]cidoffer.CIDOffer, bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FCROfferMgr ¶
type FCROfferMgr struct {
// contains filtered or unexported fields
}
FCROfferMgr manages offer storage
func (*FCROfferMgr) AddDHTOffer ¶
func (mgr *FCROfferMgr) AddDHTOffer(offer *cidoffer.CIDOffer) error
AddDHTOffer stores a dht offer
func (*FCROfferMgr) AddGroupOffer ¶
func (mgr *FCROfferMgr) AddGroupOffer(offer *cidoffer.CIDOffer) error
AddGroupOffer stores a group offer
func (*FCROfferMgr) GetDHTOffers ¶
GetDHTOffers returns a list of dht offers that contain the given cid
func (*FCROfferMgr) GetDHTOffersWithinRange ¶
func (mgr *FCROfferMgr) GetDHTOffersWithinRange(cidMin, cidMax *cid.ContentID, maxOffers int) ([]cidoffer.CIDOffer, bool)
GetDHTOffersWithinRange returns a list of dht offers contains a cid within the given range
func (*FCROfferMgr) GetGroupOffers ¶
GetGroupOffers returns a list of group offers that contain the given cid
func (*FCROfferMgr) GetOfferByDigest ¶
func (mgr *FCROfferMgr) GetOfferByDigest(digest [cidoffer.CIDOfferDigestSize]byte) (result *cidoffer.CIDOffer, exist bool)
GetOfferByDigest allows a gateway to be able to respond to a query to search for an offer by the offer digest