Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DefaultChunkSize represents the default chunk size in bytes. DefaultChunkSize = 256 // DefaultSegmentMaxChunks represents the default maximum number of chunks within a segment. DefaultSegmentMaxChunks = 1024 // DefaultSegmentSize represents the default segment size in bytes. DefaultSegmentSize = DefaultChunkSize * DefaultSegmentMaxChunks )
Variables ¶
View Source
var ( EmptyChunk = make([]byte, DefaultChunkSize) EmptyChunkHash = crypto.Keccak256Hash(EmptyChunk) )
View Source
var ( // ErrFileRequired is returned when manipulate on a folder. ErrFileRequired = errors.New("file required") // ErrFileEmpty is returned when empty file opened. ErrFileEmpty = errors.New("file is empty") )
Functions ¶
Types ¶
type Downloader ¶
type Downloader struct {
// contains filtered or unexported fields
}
func NewDownloader ¶
func NewDownloader(clients ...*node.Client) *Downloader
type File ¶
func (*File) NumSegments ¶
type Flow ¶
type Flow struct {
// contains filtered or unexported fields
}
func (*Flow) CreateSubmission ¶
func (flow *Flow) CreateSubmission() (*contract.IonianSubmission, error)
type Iterator ¶
type Iterator struct {
// contains filtered or unexported fields
}
func NewIterator ¶
func NewSegmentIterator ¶
type SegmentDownloader ¶
type SegmentDownloader struct {
// contains filtered or unexported fields
}
func NewSegmentDownloader ¶
func NewSegmentDownloader(clients []*node.Client, file *download.DownloadingFile, withProof bool) (*SegmentDownloader, error)
func (*SegmentDownloader) Download ¶
func (downloader *SegmentDownloader) Download() error
Download downloads segments in parallel.
func (*SegmentDownloader) ParallelCollect ¶
func (downloader *SegmentDownloader) ParallelCollect(result *parallel.Result) error
ParallelCollect implements the parallel.Interface interface.
func (*SegmentDownloader) ParallelDo ¶
func (downloader *SegmentDownloader) ParallelDo(routine, task int) (interface{}, error)
ParallelDo implements the parallel.Interface interface.
type UploadOption ¶
type Uploader ¶
type Uploader struct {
// contains filtered or unexported fields
}
func NewUploaderLight ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.