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 ¶
var ( // DefaultMaxConnsPerHost is the default maximum number of connections per host in the global pool (shared among all epochs) of connections // to the remote CAR storage servers. DefaultMaxConnsPerHost = 30_000 // DefaultMaxIdleConnsPerHost is the default maximum number of idle (keep-alive) connections per host in the global pool (shared among all epochs) // of connections to the remote CAR storage servers. DefaultMaxIdleConnsPerHost = 10_000 // DefaultKeepAlive is the default keep-alive period for HTTP connections to the remote CAR storage servers. DefaultKeepAlive = 180 * time.Second // DefaultTimeout is the default timeout for HTTP requests to the remote CAR storage servers. DefaultTimeout = 1000 * time.Second )
var UserAgent = "faithful-cli"
UserAgent is the User-Agent header that clients from NewHTTPClient send.
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) GetAllDeals ¶ added in v0.7.1
func (r *DealRegistry) GetAllDeals() map[cid.Cid]Deal
GetAllDeals returns a copy of all deals in the registry as a map from piece CID to Deal.
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 ¶
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 (*MinerInfoCache) GetProviderInfo ¶
type MinerInfoFetcher ¶
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