Documentation ¶
Index ¶
- func ADNameFromHeader(prefix string) func(*Download)
- type Download
- func (dl *Download) Dir() string
- func (dl *Download) Exists() (bool, error)
- func (dl *Download) File() string
- func (dl *Download) NameFromHeader() (string, error)
- func (dl *Download) Path() string
- func (dl *Download) Rename(name string) error
- func (dl *Download) SetDir(dir string) error
- func (dl *Download) SetFile(name string)
- type DownloadCounter
- type DownloadDispatcher
- type DownloadFailure
- type NoFilenameInContentDisposition
- type RenameError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ADNameFromHeader ¶
Types ¶
type Download ¶
type Download struct { Client *http.Client Addr *url.URL AllowOverride bool Err error AfterDownload func(*Download) // contains filtered or unexported fields }
func (*Download) Exists ¶
Exists returns true if there already is a file named the same as specified in the Download struct. Panics if the field "dir" or "file" is zero-valued.
func (*Download) NameFromHeader ¶
func (*Download) Path ¶
Path returns the absolute path to the (to be) downloaded file. Panics if the field "dir" or "file" is zero-valued.
func (*Download) Rename ¶
Rename changes the file name of a download. If the download already exists, it will be renamed on the file system.
type DownloadCounter ¶
type DownloadCounter struct {
// contains filtered or unexported fields
}
func NewDownloadCounter ¶
func NewDownloadCounter() *DownloadCounter
func (*DownloadCounter) Count ¶
func (dc *DownloadCounter) Count() uint64
type DownloadDispatcher ¶
type DownloadDispatcher struct {
// contains filtered or unexported fields
}
func NewDownloadDispatcher ¶
func NewDownloadDispatcher(downloads int) *DownloadDispatcher
func (*DownloadDispatcher) ChooChoo ¶
func (r *DownloadDispatcher) ChooChoo()
func (*DownloadDispatcher) Close ¶
func (r *DownloadDispatcher) Close()
func (*DownloadDispatcher) Collect ¶
func (r *DownloadDispatcher) Collect() *Download
func (*DownloadDispatcher) Dispatch ¶
func (r *DownloadDispatcher) Dispatch(dl *Download)
type DownloadFailure ¶
type DownloadFailure struct {
// contains filtered or unexported fields
}
func (DownloadFailure) Error ¶
func (e DownloadFailure) Error() string
type NoFilenameInContentDisposition ¶
type NoFilenameInContentDisposition struct {
// contains filtered or unexported fields
}
func (NoFilenameInContentDisposition) Error ¶
func (e NoFilenameInContentDisposition) Error() string
type RenameError ¶
type RenameError struct {
// contains filtered or unexported fields
}
RenameError is thrown if renaming a downloaded file fails.
func NewRenameError ¶
func NewRenameError(name string, newname string, err error) RenameError
func (RenameError) Error ¶
func (e RenameError) Error() string
func (RenameError) Unwrap ¶
func (e RenameError) Unwrap() error
Click to show internal directories.
Click to hide internal directories.