Documentation ¶
Index ¶
Constants ¶
View Source
const ( NetworkFIL = "fil" NetworkIPFS = "ipfs" NetworkAuto = "auto" )
Variables ¶
View Source
var ApiURL string = "wss://api.chain.love"
Functions ¶
Types ¶
type FILRetrievalAttempt ¶
type FILRetrievalAttempt struct { FilClient *filclient.FilClient Cid cid.Cid Candidates []FILRetrievalCandidate SelNode ipld.Node // Disable sorting of candidates based on preferability NoSort bool }
func (*FILRetrievalAttempt) Retrieve ¶
func (attempt *FILRetrievalAttempt) Retrieve(ctx context.Context, node *whypfs.Node) (RetrievalStats, error)
type FILRetrievalCandidate ¶
type FILRetrievalCandidate struct { Miner address.Address RootCid cid.Cid DealID uint }
func GetRetrievalCandidates ¶
func GetRetrievalCandidates(endpoint string, c cid.Cid) ([]FILRetrievalCandidate, error)
type FILRetrievalStats ¶
type FILRetrievalStats struct {
filclient.RetrievalStats
}
func (*FILRetrievalStats) GetAverageBytesPerSecond ¶
func (stats *FILRetrievalStats) GetAverageBytesPerSecond() uint64
func (*FILRetrievalStats) GetByteSize ¶
func (stats *FILRetrievalStats) GetByteSize() uint64
func (*FILRetrievalStats) GetDuration ¶
func (stats *FILRetrievalStats) GetDuration() time.Duration
type GetAttempt ¶
A get attempt is a configuration for performing a specific fetch over a specific network
type IPFSRetrievalAttempt ¶
type IPFSRetrievalAttempt struct {
Cid cid.Cid
}
func (*IPFSRetrievalAttempt) Retrieve ¶
func (attempt *IPFSRetrievalAttempt) Retrieve(ctx context.Context, node *whypfs.Node) (RetrievalStats, error)
type IPFSRetrievalStats ¶
func (*IPFSRetrievalStats) GetAverageBytesPerSecond ¶
func (stats *IPFSRetrievalStats) GetAverageBytesPerSecond() uint64
func (*IPFSRetrievalStats) GetByteSize ¶
func (stats *IPFSRetrievalStats) GetByteSize() uint64
func (*IPFSRetrievalStats) GetDuration ¶
func (stats *IPFSRetrievalStats) GetDuration() time.Duration
type RetrievalStats ¶
type RetrievalStats interface { GetByteSize() uint64 GetDuration() time.Duration GetAverageBytesPerSecond() uint64 }
func RetrieveFromBestCandidate ¶
func RetrieveFromBestCandidate( node *whypfs.Node, ctx context.Context, attempts []GetAttempt, ) (RetrievalStats, error)
Takes a list of network configs to attempt to retrieve from, in order. Valid structs for the interface: IPFSRetrievalConfig, FILRetrievalConfig
Click to show internal directories.
Click to hide internal directories.