Documentation
¶
Index ¶
- type Aria2Input
- type Aria2RPCData
- type Downloader
- func (downloader *Downloader) Download(data *types.Data) error
- func (downloader *Downloader) GetInfo(d *types.Data) (Site, Title, Type string, Size int64, FileNameLength int, stream *types.Stream)
- func (downloader *Downloader) GetSize(part *types.Part, refer, fileName string) (savedSize int64, err error)
- type FilePartMeta
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Aria2Input ¶
type Aria2Input struct {
// The file name of the downloaded file
Out string `json:"out"`
// For a simple download, only add headers
Header []string `json:"header"`
}
Aria2Input is options for `aria2.addUri` https://aria2.github.io/manual/en/html/aria2c.html#id3
type Aria2RPCData ¶
type Aria2RPCData struct {
// More info about RPC interface please refer to
// https://aria2.github.io/manual/en/html/aria2c.html#rpc-interface
JSONRPC string `json:"jsonrpc"`
ID string `json:"id"`
// For a simple download, only inplemented `addUri`
Method string `json:"method"`
// secret, uris, options
Params [3]interface{} `json:"params"`
}
Aria2RPCData defines the data structure of json RPC 2.0 info for Aria2
type Downloader ¶
type Downloader struct {
// contains filtered or unexported fields
}
Downloader is the default downloader.
func (*Downloader) Download ¶
func (downloader *Downloader) Download(data *types.Data) error
Download download urls
type FilePartMeta ¶
FilePartMeta defines the data structure of file meta info.
type Options ¶
type Options struct {
InfoOnly bool
Silent bool
Stream string
Refer string
OutputPath string
OutputName string
FileNameLength int
Caption bool
MultiThread bool
ThreadNumber int
RetryTimes int
ChunkSizeMB int
// Aria2
UseAria2RPC bool
Aria2Token string
Aria2Method string
Aria2Addr string
}
Options defines options used in downloading.
Click to show internal directories.
Click to hide internal directories.