Documentation ¶
Overview ¶
Package fcroffermgr - offer manager manages all offers stored.
Package fcroffermgr - offer manager manages all offers stored.
Package fcroffermgr - offer manager manages all offers stored.
Index ¶
- type FCROfferMgr
- type FCROfferMgrImplV1
- func (mgr *FCROfferMgrImplV1) AddCIDTag(cid *cid.ContentID, tag string)
- func (mgr *FCROfferMgrImplV1) AddOffer(offer *cidoffer.CIDOffer)
- func (mgr *FCROfferMgrImplV1) AddSubOffer(offer *cidoffer.SubCIDOffer)
- func (mgr *FCROfferMgrImplV1) GetAccessCountByCID(cid *cid.ContentID) int
- func (mgr *FCROfferMgrImplV1) GetCIDByTag(tag string) string
- func (mgr *FCROfferMgrImplV1) GetOfferByDigest(digest string) *cidoffer.CIDOffer
- func (mgr *FCROfferMgrImplV1) GetOffers(cid *cid.ContentID) []cidoffer.CIDOffer
- func (mgr *FCROfferMgrImplV1) GetOffersByTag(tag string) []cidoffer.CIDOffer
- func (mgr *FCROfferMgrImplV1) GetSubOfferByDigest(digest string) *cidoffer.SubCIDOffer
- func (mgr *FCROfferMgrImplV1) GetSubOffers(cID *cid.ContentID) []cidoffer.SubCIDOffer
- func (mgr *FCROfferMgrImplV1) GetTagByCID(cid *cid.ContentID) string
- func (mgr *FCROfferMgrImplV1) IncrementCIDAccessCount(cid *cid.ContentID)
- func (mgr *FCROfferMgrImplV1) ListAccessCount(from uint, to uint) ([]string, []int)
- func (mgr *FCROfferMgrImplV1) ListOffers(from uint, to uint) []cidoffer.CIDOffer
- func (mgr *FCROfferMgrImplV1) ListSubOffers(from uint, to uint) []cidoffer.SubCIDOffer
- func (mgr *FCROfferMgrImplV1) RemoveOffer(digest string)
- func (mgr *FCROfferMgrImplV1) RemoveSubOffer(digest string)
- func (mgr *FCROfferMgrImplV1) Shutdown()
- func (mgr *FCROfferMgrImplV1) Start() error
- type FCROfferMgrImplV2
- func (mgr *FCROfferMgrImplV2) AddCIDTag(cid *cid.ContentID, tag string)
- func (mgr *FCROfferMgrImplV2) AddOffer(o *cidoffer.CIDOffer)
- func (mgr *FCROfferMgrImplV2) AddSubOffer(o *cidoffer.SubCIDOffer)
- func (mgr *FCROfferMgrImplV2) GetAccessCountByCID(cid *cid.ContentID) int
- func (mgr *FCROfferMgrImplV2) GetCIDByTag(tag string) string
- func (mgr *FCROfferMgrImplV2) GetOfferByDigest(digest string) *cidoffer.CIDOffer
- func (mgr *FCROfferMgrImplV2) GetOffers(c *cid.ContentID) []cidoffer.CIDOffer
- func (mgr *FCROfferMgrImplV2) GetOffersByTag(tag string) []cidoffer.CIDOffer
- func (mgr *FCROfferMgrImplV2) GetSubOfferByDigest(digest string) *cidoffer.SubCIDOffer
- func (mgr *FCROfferMgrImplV2) GetSubOffers(cID *cid.ContentID) []cidoffer.SubCIDOffer
- func (mgr *FCROfferMgrImplV2) GetTagByCID(cid *cid.ContentID) string
- func (mgr *FCROfferMgrImplV2) IncrementCIDAccessCount(cid *cid.ContentID)
- func (mgr *FCROfferMgrImplV2) ListAccessCount(from uint, to uint) ([]string, []int)
- func (mgr *FCROfferMgrImplV2) ListOffers(from uint, to uint) []cidoffer.CIDOffer
- func (mgr *FCROfferMgrImplV2) ListSubOffers(from uint, to uint) []cidoffer.SubCIDOffer
- func (mgr *FCROfferMgrImplV2) RemoveOffer(digest string)
- func (mgr *FCROfferMgrImplV2) RemoveSubOffer(digest string)
- func (mgr *FCROfferMgrImplV2) Shutdown()
- func (mgr *FCROfferMgrImplV2) Start() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FCROfferMgr ¶
type FCROfferMgr interface { // Start starts the manager's routine. Start() error // Shutdown ends the manager's routine safely. Shutdown() /* CID related functions */ // AddCIDTag adds a cid to system and its tag. // If cid already existed, it fails silently AddCIDTag(cid *cid.ContentID, tag string) // GetTagByCID gets the tag associated by the given cid. GetTagByCID(cid *cid.ContentID) string // GetCIDByTag gets the cid string associated by the given tag. GetCIDByTag(tag string) string // IncrementCIDAccessCount increments the access count for a given cid. IncrementCIDAccessCount(cid *cid.ContentID) // GetAccessCountByCID gets the access count of a given cid. GetAccessCountByCID(cid *cid.ContentID) int // ListAccessCount lists the cid and access count from most accessed to least accessed ListAccessCount(from uint, to uint) ([]string, []int) /* CID Offer related functions */ // AddOffer adds an cid offer to the storage. // If calling from provider, needs to first call add cid tag to track tag. AddOffer(offer *cidoffer.CIDOffer) // GetOffers gets offers containing given cid. GetOffers(cID *cid.ContentID) []cidoffer.CIDOffer // ListOffers gets a list of offers from given index to given index. ListOffers(from uint, to uint) []cidoffer.CIDOffer // GetOfferByDigest GetOfferByDigest(digest string) *cidoffer.CIDOffer // RemoveOffer removes an offer by digest RemoveOffer(digest string) /* SubCID Offer related functions */ // AddSubOffer adds an cid offer to the storage. AddSubOffer(offer *cidoffer.SubCIDOffer) // GetSubOffers gets offers containing given cid. GetSubOffers(cID *cid.ContentID) []cidoffer.SubCIDOffer // ListSubOffers gets a list of offers from given index to given index. ListSubOffers(from uint, to uint) []cidoffer.SubCIDOffer // GetSubOfferByDigest GetSubOfferByDigest(digest string) *cidoffer.SubCIDOffer // RemoveSubOffer removes an offer by digest RemoveSubOffer(digest string) }
FCROfferMgr represents the manager that manages all stored offers.
func NewFCROfferMgrImplV1 ¶
func NewFCROfferMgrImplV1(tracking bool) FCROfferMgr
func NewFCROfferMgrImplV2 ¶
func NewFCROfferMgrImplV2(tracking bool) FCROfferMgr
type FCROfferMgrImplV1 ¶
type FCROfferMgrImplV1 struct {
// contains filtered or unexported fields
}
FCROfferMgrImplV1 implements FCROfferMgr interface, it is an in-memory version.
func (*FCROfferMgrImplV1) AddCIDTag ¶
func (mgr *FCROfferMgrImplV1) AddCIDTag(cid *cid.ContentID, tag string)
func (*FCROfferMgrImplV1) AddOffer ¶
func (mgr *FCROfferMgrImplV1) AddOffer(offer *cidoffer.CIDOffer)
func (*FCROfferMgrImplV1) AddSubOffer ¶
func (mgr *FCROfferMgrImplV1) AddSubOffer(offer *cidoffer.SubCIDOffer)
func (*FCROfferMgrImplV1) GetAccessCountByCID ¶
func (mgr *FCROfferMgrImplV1) GetAccessCountByCID(cid *cid.ContentID) int
func (*FCROfferMgrImplV1) GetCIDByTag ¶
func (mgr *FCROfferMgrImplV1) GetCIDByTag(tag string) string
func (*FCROfferMgrImplV1) GetOfferByDigest ¶
func (mgr *FCROfferMgrImplV1) GetOfferByDigest(digest string) *cidoffer.CIDOffer
func (*FCROfferMgrImplV1) GetOffers ¶
func (mgr *FCROfferMgrImplV1) GetOffers(cid *cid.ContentID) []cidoffer.CIDOffer
func (*FCROfferMgrImplV1) GetOffersByTag ¶
func (mgr *FCROfferMgrImplV1) GetOffersByTag(tag string) []cidoffer.CIDOffer
func (*FCROfferMgrImplV1) GetSubOfferByDigest ¶
func (mgr *FCROfferMgrImplV1) GetSubOfferByDigest(digest string) *cidoffer.SubCIDOffer
func (*FCROfferMgrImplV1) GetSubOffers ¶
func (mgr *FCROfferMgrImplV1) GetSubOffers(cID *cid.ContentID) []cidoffer.SubCIDOffer
func (*FCROfferMgrImplV1) GetTagByCID ¶
func (mgr *FCROfferMgrImplV1) GetTagByCID(cid *cid.ContentID) string
func (*FCROfferMgrImplV1) IncrementCIDAccessCount ¶
func (mgr *FCROfferMgrImplV1) IncrementCIDAccessCount(cid *cid.ContentID)
func (*FCROfferMgrImplV1) ListAccessCount ¶
func (mgr *FCROfferMgrImplV1) ListAccessCount(from uint, to uint) ([]string, []int)
func (*FCROfferMgrImplV1) ListOffers ¶
func (mgr *FCROfferMgrImplV1) ListOffers(from uint, to uint) []cidoffer.CIDOffer
func (*FCROfferMgrImplV1) ListSubOffers ¶
func (mgr *FCROfferMgrImplV1) ListSubOffers(from uint, to uint) []cidoffer.SubCIDOffer
func (*FCROfferMgrImplV1) RemoveOffer ¶
func (mgr *FCROfferMgrImplV1) RemoveOffer(digest string)
func (*FCROfferMgrImplV1) RemoveSubOffer ¶
func (mgr *FCROfferMgrImplV1) RemoveSubOffer(digest string)
func (*FCROfferMgrImplV1) Shutdown ¶
func (mgr *FCROfferMgrImplV1) Shutdown()
func (*FCROfferMgrImplV1) Start ¶
func (mgr *FCROfferMgrImplV1) Start() error
type FCROfferMgrImplV2 ¶
type FCROfferMgrImplV2 struct {
// contains filtered or unexported fields
}
FCROfferMgrImplV2 implements FCROfferMgr interface, it is a sqlite database version.
func (*FCROfferMgrImplV2) AddCIDTag ¶
func (mgr *FCROfferMgrImplV2) AddCIDTag(cid *cid.ContentID, tag string)
func (*FCROfferMgrImplV2) AddOffer ¶
func (mgr *FCROfferMgrImplV2) AddOffer(o *cidoffer.CIDOffer)
AddOffer stores a offer
func (*FCROfferMgrImplV2) AddSubOffer ¶
func (mgr *FCROfferMgrImplV2) AddSubOffer(o *cidoffer.SubCIDOffer)
func (*FCROfferMgrImplV2) GetAccessCountByCID ¶
func (mgr *FCROfferMgrImplV2) GetAccessCountByCID(cid *cid.ContentID) int
func (*FCROfferMgrImplV2) GetCIDByTag ¶
func (mgr *FCROfferMgrImplV2) GetCIDByTag(tag string) string
func (*FCROfferMgrImplV2) GetOfferByDigest ¶
func (mgr *FCROfferMgrImplV2) GetOfferByDigest(digest string) *cidoffer.CIDOffer
GetOfferByDigest returns an offer for given digest
func (*FCROfferMgrImplV2) GetOffers ¶
func (mgr *FCROfferMgrImplV2) GetOffers(c *cid.ContentID) []cidoffer.CIDOffer
GetOffers returns a list of offers that contain the given cid
func (*FCROfferMgrImplV2) GetOffersByTag ¶
func (mgr *FCROfferMgrImplV2) GetOffersByTag(tag string) []cidoffer.CIDOffer
func (*FCROfferMgrImplV2) GetSubOfferByDigest ¶
func (mgr *FCROfferMgrImplV2) GetSubOfferByDigest(digest string) *cidoffer.SubCIDOffer
func (*FCROfferMgrImplV2) GetSubOffers ¶
func (mgr *FCROfferMgrImplV2) GetSubOffers(cID *cid.ContentID) []cidoffer.SubCIDOffer
func (*FCROfferMgrImplV2) GetTagByCID ¶
func (mgr *FCROfferMgrImplV2) GetTagByCID(cid *cid.ContentID) string
func (*FCROfferMgrImplV2) IncrementCIDAccessCount ¶
func (mgr *FCROfferMgrImplV2) IncrementCIDAccessCount(cid *cid.ContentID)
func (*FCROfferMgrImplV2) ListAccessCount ¶
func (mgr *FCROfferMgrImplV2) ListAccessCount(from uint, to uint) ([]string, []int)
func (*FCROfferMgrImplV2) ListOffers ¶
func (mgr *FCROfferMgrImplV2) ListOffers(from uint, to uint) []cidoffer.CIDOffer
func (*FCROfferMgrImplV2) ListSubOffers ¶
func (mgr *FCROfferMgrImplV2) ListSubOffers(from uint, to uint) []cidoffer.SubCIDOffer
func (*FCROfferMgrImplV2) RemoveOffer ¶
func (mgr *FCROfferMgrImplV2) RemoveOffer(digest string)
RemoveOffer removes an offer
func (*FCROfferMgrImplV2) RemoveSubOffer ¶
func (mgr *FCROfferMgrImplV2) RemoveSubOffer(digest string)
func (*FCROfferMgrImplV2) Shutdown ¶
func (mgr *FCROfferMgrImplV2) Shutdown()
func (*FCROfferMgrImplV2) Start ¶
func (mgr *FCROfferMgrImplV2) Start() error
Click to show internal directories.
Click to hide internal directories.