Documentation ¶
Index ¶
- Constants
- type Client
- func (c *Client) Cancel(id int)
- func (c *Client) ClearCompleted()
- func (c *Client) Get(id int) (Download, error)
- func (c *Client) GetAll() []Download
- func (c *Client) Pause(id int)
- func (c *Client) Queue(url, path string) (id int)
- func (c *Client) Resume(id int)
- func (c *Client) Retry(id int)
- func (c *Client) Run()
- func (c *Client) Shutdown()
- func (c *Client) WithStatus(s ...DownloadStatus) []Download
- type Download
- type DownloadStatus
- type Header
- type Options
- type SectionWriter
Constants ¶
View Source
const MIN_LEN_TO_SPLIT = 100 * 1e+6 // 100 mb
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) ClearCompleted ¶
func (c *Client) ClearCompleted()
func (*Client) WithStatus ¶
func (c *Client) WithStatus(s ...DownloadStatus) []Download
type Download ¶
type Download struct { ID int `json:"id"` Name string `json:"name"` Status DownloadStatus `json:"status"` Downloaded int `json:"dl"` Total int `json:"total"` // contains filtered or unexported fields }
type DownloadStatus ¶
type DownloadStatus int
const ( Error DownloadStatus = iota Queued Paused Prefilling Downloading Finished Cancelled )
type SectionWriter ¶
type SectionWriter struct {
// contains filtered or unexported fields
}
func NewSectionWriter ¶
func NewSectionWriter(w io.WriterAt, off int64, n int64) *SectionWriter
NewSectionWriter returns a SectionWriter that writes to w starting at offset off and stops with EOF after n bytes.
Click to show internal directories.
Click to hide internal directories.