Documentation ¶
Index ¶
- Constants
- Variables
- func AddGlobalProgressBar(d *Download)
- func AddLocalProgressBar(index int, pieceCount int, r *ByteRange)
- func DownloadPath(defaultFileName string) string
- func InitializeProgress(width int)
- func ShutdownProgress(success bool)
- type ByteRange
- type BytesWrote
- type ControlFile
- type ControlWriter
- type Download
- type DownloadWriter
- type GlobalBarInfo
- type Metadata
- type RangeBarInfo
Constants ¶
View Source
const ( WriteBufferSize = 64 * 1024 // 64 KiB DiskAllocationWarningSize = 24 * 1024 * 1024 // 24 MiB ProgressCompletedSize = 10000 )
View Source
const ( RefreshRate = 120 * time.Millisecond SpeedAverageWindow = 45.0 // 45 seconds BarStyle = "|-> |" )
Variables ¶
View Source
var (
NewID chan int64
)
Functions ¶
func AddGlobalProgressBar ¶ added in v0.1.4
func AddGlobalProgressBar(d *Download)
func AddLocalProgressBar ¶ added in v0.1.4
func DownloadPath ¶
func InitializeProgress ¶ added in v0.1.4
func InitializeProgress(width int)
func ShutdownProgress ¶ added in v0.1.4
func ShutdownProgress(success bool)
Types ¶
type ByteRange ¶ added in v0.1.6
func NewByteRange ¶ added in v0.1.6
type BytesWrote ¶ added in v0.1.6
type ControlFile ¶ added in v0.1.4
func ParseControlFile ¶ added in v0.1.4
func ParseControlFile(filePath string) (*ControlFile, error)
func (*ControlFile) String ¶ added in v0.1.4
func (cf *ControlFile) String() string
type ControlWriter ¶ added in v0.1.6
type ControlWriter struct { io.WriterAt Cancelled chan bool // contains filtered or unexported fields }
func NewControlWriter ¶ added in v0.1.6
func NewControlWriter(w io.WriterAt, offset int64) *ControlWriter
type Download ¶
type Download struct { ID int64 Status int URL string Name string Size int64 Remaining int64 SupportsRange bool Ranges []*ByteRange Writers []*DownloadWriter ControlWriters []*ControlWriter FilePath string Started time.Time Finished time.Time WasPaused bool Retries int InProgress bool Paused bool Cancelled bool *sync.RWMutex // contains filtered or unexported fields }
func (*Download) GetDownloaded ¶ added in v0.1.4
func (*Download) GetVerboseDownloaded ¶ added in v0.1.6
type DownloadWriter ¶ added in v0.1.6
func NewDownloadWriter ¶ added in v0.1.6
func NewDownloadWriter(w io.WriterAt, r *ByteRange) *DownloadWriter
type GlobalBarInfo ¶ added in v0.1.4
type GlobalBarInfo struct { Name string Size int64 Pieces int Progress chan *BytesWrote }
type RangeBarInfo ¶ added in v0.1.4
type RangeBarInfo struct { Index int Size int64 Progress chan *BytesWrote }
Click to show internal directories.
Click to hide internal directories.