offermgr

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: 5 Imported by: 0

Documentation

Overview

FCROfferMgr manages offer storage

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
}

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(c *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(c *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) (*cidoffer.CIDOffer, 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(c *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