Versions in this module Expand all Collapse all v1 v1.0.3 May 3, 2020 v1.0.2 May 2, 2020 Changes in this version + const DefaultBlockSize + var ErrUnknownRangeGenMode = errors.New("Unknown RangeGenMode") + var RangeGenMode_name = map[int32]string + var RangeGenMode_value = map[string]int32 + type DownloadInstanceInfo struct + DownloadStatus *DownloadStatus + Ranges RangeList + type DownloadInstanceInfoExport struct + BlockSize int64 + GenBegin int64 + RangeGenMode RangeGenMode + Ranges []*Range + TotalSize int64 + XXX_NoUnkeyedLiteral struct{} + XXX_sizecache int32 + XXX_unrecognized []byte + func (*DownloadInstanceInfoExport) Descriptor() ([]byte, []int) + func (*DownloadInstanceInfoExport) ProtoMessage() + func (m *DownloadInstanceInfoExport) GetBlockSize() int64 + func (m *DownloadInstanceInfoExport) GetGenBegin() int64 + func (m *DownloadInstanceInfoExport) GetInstanceInfo() (eii *DownloadInstanceInfo) + func (m *DownloadInstanceInfoExport) GetRangeGenMode() RangeGenMode + func (m *DownloadInstanceInfoExport) GetRanges() []*Range + func (m *DownloadInstanceInfoExport) GetTotalSize() int64 + func (m *DownloadInstanceInfoExport) Reset() + func (m *DownloadInstanceInfoExport) SetInstanceInfo(eii *DownloadInstanceInfo) + func (m *DownloadInstanceInfoExport) String() string + func (m *DownloadInstanceInfoExport) XXX_DiscardUnknown() + func (m *DownloadInstanceInfoExport) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *DownloadInstanceInfoExport) XXX_Merge(src proto.Message) + func (m *DownloadInstanceInfoExport) XXX_Size() int + func (m *DownloadInstanceInfoExport) XXX_Unmarshal(b []byte) error + type DownloadInstanceInfoExporter interface + GetInstanceInfo func() *DownloadInstanceInfo + SetInstanceInfo func(*DownloadInstanceInfo) + type DownloadStatus struct + func NewDownloadStatus() *DownloadStatus + func (ds *DownloadStatus) AddDownloaded(d int64) + func (ds *DownloadStatus) AddSpeedsDownloaded(d int64) + func (ds *DownloadStatus) AddTotalSize(size int64) + func (ds *DownloadStatus) ClearMaxSpeeds() + func (ds *DownloadStatus) Downloaded() int64 + func (ds *DownloadStatus) MaxSpeeds() int64 + func (ds *DownloadStatus) RangeListGen() *RangeListGen + func (ds *DownloadStatus) SetMaxSpeeds(speeds int64) + func (ds *DownloadStatus) SetRangeListGen(gen *RangeListGen) + func (ds *DownloadStatus) SetRateLimit(rl *speeds.RateLimit) + func (ds *DownloadStatus) SetTotalSize(size int64) + func (ds *DownloadStatus) SpeedsPerSecond() int64 + func (ds *DownloadStatus) TimeElapsed() (elapsed time.Duration) + func (ds *DownloadStatus) TimeLeft() (left time.Duration) + func (ds *DownloadStatus) TotalSize() int64 + func (ds *DownloadStatus) UpdateSpeeds() + type DownloadStatuser interface + Downloaded func() int64 + SpeedsPerSecond func() int64 + TimeElapsed func() time.Duration + TimeLeft func() time.Duration + TotalSize func() int64 + type Range struct + Begin int64 + End int64 + XXX_NoUnkeyedLiteral struct{} + XXX_sizecache int32 + XXX_unrecognized []byte + func (*Range) Descriptor() ([]byte, []int) + func (*Range) ProtoMessage() + func (m *Range) GetBegin() int64 + func (m *Range) GetEnd() int64 + func (m *Range) Reset() + func (m *Range) String() string + func (m *Range) XXX_DiscardUnknown() + func (m *Range) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *Range) XXX_Merge(src proto.Message) + func (m *Range) XXX_Size() int + func (m *Range) XXX_Unmarshal(b []byte) error + func (r *Range) AddBegin(i int64) (newi int64) + func (r *Range) Len() int64 + func (r *Range) LoadBegin() int64 + func (r *Range) LoadEnd() int64 + func (r *Range) ShowDetails() string + func (r *Range) StoreBegin(end int64) + func (r *Range) StoreEnd(end int64) + type RangeGenMode int32 + const RangeGenMode_BlockSize + const RangeGenMode_Default + func (RangeGenMode) EnumDescriptor() ([]byte, []int) + func (x RangeGenMode) String() string + type RangeList []*Range + func (rl *RangeList) Len() int64 + type RangeListGen struct + func NewRangeListGenBlockSize(totalSize, begin, blockSize int64) *RangeListGen + func NewRangeListGenDefault(totalSize, begin int64, count, parallel int) *RangeListGen + func (gen *RangeListGen) GenRange() (index int, r *Range) + func (gen *RangeListGen) IsDone() bool + func (gen *RangeListGen) LoadBegin() (begin int64) + func (gen *RangeListGen) LoadBlockSize() (blockSize int64) + func (gen *RangeListGen) RangeCount() (rangeCount int) + func (gen *RangeListGen) RangeGenMode() RangeGenMode