Documentation ¶
Index ¶
- Variables
- func Fetch(url string, dir string, dest string, chunksize uint64) (err error)
- func GetFilename(URL string) string
- func NewRequest(ctx context.Context, method, URL string, header []GdlHeader) (req *http.Request, err error)
- type Chunk
- type Download
- func (d *Download) Context() context.Context
- func (d *Download) DownloadChunk(c *Chunk, dest io.Writer) error
- func (d *Download) GetInfoOrDownload() (*Info, error)
- func (d *Download) Init() (err error)
- func (d *Download) Path() string
- func (d *Download) Size() uint64
- func (d *Download) Start() (err error)
- func (d *Download) TotalSize() uint64
- func (d *Download) Write(b []byte) (int, error)
- type Gdl
- type GdlHeader
- type Info
- type OffsetWriter
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultClient = &http.Client{ Transport: &http.Transport{ MaxIdleConns: 10, IdleConnTimeout: 30 * time.Second, TLSHandshakeTimeout: 5 * time.Second, Proxy: http.ProxyFromEnvironment, }, }
View Source
var DefaultFileName = "gdl.output"
View Source
var ErrDownloadAborted = errors.New("Operation aborted")
View Source
var UserAgent = "GDL/1.0"
Functions ¶
func GetFilename ¶
Types ¶
type Download ¶
type Download struct { Client *http.Client Concurrency uint URL, Dir, Dest string Interval, ChunkSize, MinChunkSize, MaxChunkSize uint64 Header []GdlHeader // contains filtered or unexported fields }
func (*Download) GetInfoOrDownload ¶
type Gdl ¶
func NewWithContext ¶
type OffsetWriter ¶
Click to show internal directories.
Click to hide internal directories.