Documentation ¶
Index ¶
- Variables
- func GetContentSizeWithHeadOrZeroRange(url string) (int64, error)
- func NewHTTPClient() *http.Client
- func NewHTTPTransport() *http.Transport
- type Deal
- type DealRegistry
- type FileSplitCarReader
- type HTTPSingleFileRemoteReaderAt
- type Metadata
- type MinerInfo
- type MinerInfoCache
- type MinerInfoFetcher
- type MultiReaderAt
- type ReaderAtCloserSize
- type SplitCarFileReaderCreator
- type SplitCarReader
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultMaxIdleConnsPerHost = 100 DefaultTimeout = 1000 * time.Second DefaultKeepAlive = 180 * time.Second )
Functions ¶
func NewHTTPClient ¶
NewHTTPClient returns a new Client from the provided config. Client is safe for concurrent use by multiple goroutines.
func NewHTTPTransport ¶
Types ¶
type Deal ¶
type Deal struct { Provider address.Address DealUUID string FileName string URL string CommpPieceCID cid.Cid FileSize int64 PaddedFileSize int64 PayloadCID string }
provider,deal_uuid,file_name,url,commp_piece_cid,file_size,padded_size,payload_cid
type DealRegistry ¶
type DealRegistry struct {
// contains filtered or unexported fields
}
func DealsFromCSV ¶
func DealsFromCSV(path string) (*DealRegistry, error)
DealsFromCSV reads a CSV file and returns a DealRegistry.
func NewDealRegistry ¶
func NewDealRegistry() *DealRegistry
func (*DealRegistry) GetDeal ¶
func (r *DealRegistry) GetDeal(pieceCID cid.Cid) (Deal, bool)
GetDeal returns the deal associated with the given piece CID.
func (*DealRegistry) GetMinerByPieceCID ¶
func (r *DealRegistry) GetMinerByPieceCID(pieceCID cid.Cid) (address.Address, bool)
GetMinerByPieceCID returns the miner associated with the given piece CID.
type FileSplitCarReader ¶
type FileSplitCarReader struct {
// contains filtered or unexported fields
}
func NewFileSplitCarReader ¶
func NewFileSplitCarReader(filepath string) (*FileSplitCarReader, error)
func (*FileSplitCarReader) Close ¶
func (fscr *FileSplitCarReader) Close() error
func (*FileSplitCarReader) ReadAt ¶
func (fscr *FileSplitCarReader) ReadAt(p []byte, off int64) (n int, err error)
func (*FileSplitCarReader) Size ¶
func (fscr *FileSplitCarReader) Size() int64
type HTTPSingleFileRemoteReaderAt ¶
type HTTPSingleFileRemoteReaderAt struct {
// contains filtered or unexported fields
}
func (*HTTPSingleFileRemoteReaderAt) Close ¶
func (r *HTTPSingleFileRemoteReaderAt) Close() error
Close implements io.Closer.
func (*HTTPSingleFileRemoteReaderAt) ReadAt ¶
func (r *HTTPSingleFileRemoteReaderAt) ReadAt(p []byte, off int64) (n int, err error)
func (*HTTPSingleFileRemoteReaderAt) Size ¶
func (r *HTTPSingleFileRemoteReaderAt) Size() int64
Size returns the size of the file.
type Metadata ¶
type Metadata struct {
CarPieces *carlet.CarPiecesAndMetadata `yaml:"car_pieces_meta"`
}
func MetadataFromYaml ¶
type MinerInfoCache ¶
type MinerInfoCache struct {
// contains filtered or unexported fields
}
func NewMinerInfo ¶
func NewMinerInfo( lotusClient jsonrpc.RPCClient, cacheTTL time.Duration, requestTimeout time.Duration, ) *MinerInfoCache
func (*MinerInfoCache) GetProviderInfo ¶
func (d *MinerInfoCache) GetProviderInfo(ctx context.Context, provider address.Address) (*MinerInfo, error)
type MinerInfoFetcher ¶
type MinerInfoFetcher struct {
Client jsonrpc.RPCClient
}
func (*MinerInfoFetcher) GetProviderInfo ¶
type MultiReaderAt ¶
type MultiReaderAt struct {
// contains filtered or unexported fields
}
func NewMultiReaderAt ¶
func NewMultiReaderAt(readers []io.ReaderAt, sizes []int64) *MultiReaderAt
type ReaderAtCloserSize ¶
func NewRemoteHTTPFileAsIoReaderAt ¶
func NewRemoteHTTPFileAsIoReaderAt(ctx context.Context, url string) (ReaderAtCloserSize, int64, error)
NewRemoteHTTPFileAsIoReaderAt returns a ReaderAtCloser for a remote file. The returned ReaderAtCloser is backed by a http.Client.
type SplitCarFileReaderCreator ¶
type SplitCarFileReaderCreator func(carFile carlet.CarFile) (ReaderAtCloserSize, error)
type SplitCarReader ¶
type SplitCarReader struct {
// contains filtered or unexported fields
}
func NewSplitCarReader ¶
func NewSplitCarReader( files *carlet.CarPiecesAndMetadata, readerCreator SplitCarFileReaderCreator, ) (*SplitCarReader, error)
func (*SplitCarReader) Close ¶
func (scr *SplitCarReader) Close() error
Click to show internal directories.
Click to hide internal directories.