fcroffermgr

package
v0.0.0-...-12ab560 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

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

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 NewFCROfferMgr

func NewFCROfferMgr() *FCROfferMgr

NewFCROfferMgr returns

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

func (mgr *FCROfferMgr) GetDHTOffers(cid *cid.ContentID) ([]cidoffer.CIDOffer, bool)

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

func (mgr *FCROfferMgr) GetGroupOffers(cid *cid.ContentID) ([]cidoffer.CIDOffer, bool)

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

func (*FCROfferMgr) GetOffers

func (mgr *FCROfferMgr) GetOffers(cid *cid.ContentID) ([]cidoffer.CIDOffer, bool)

GetOffers returns a list of all offers (group or dht) that contain the given cid

Jump to

Keyboard shortcuts

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