Documentation ¶
Overview ¶
Package downloader contains downloading files helpers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Download ¶
type Download struct {
// contains filtered or unexported fields
}
Download represents Telegram file download.
func NewDownload ¶
NewDownload creates new Download struct.
type Downloader ¶
type Downloader struct {
// contains filtered or unexported fields
}
Downloader is Telegram file downloader.
func (*Downloader) Download ¶
func (d *Downloader) Download(ctx context.Context, rpc *tg.Client, download Download) (tg.StorageFileTypeClass, error)
Download download data from Telegram server to given output.
func (*Downloader) WithPartSize ¶
func (d *Downloader) WithPartSize(partSize int) *Downloader
WithPartSize sets part size. Must be divisible by 4KB.
type RedirectError ¶
type RedirectError struct {
*tg.UploadFileCdnRedirect
}
RedirectError error is returned when Downloader get CDN redirect. See https://core.telegram.org/constructor/upload.fileCdnRedirect.
func (*RedirectError) Error ¶
func (r *RedirectError) Error() string
Error implements error interface.
Click to show internal directories.
Click to hide internal directories.