Add options for Open and implement Range for all remotes

This commit is contained in:
Nick Craig-Wood
2016-10-05 21:03:56 +01:00
parent 75e5e59385
commit aef2ac5c04
33 changed files with 547 additions and 78 deletions
+3 -3
View File
@@ -13,13 +13,13 @@ type DownloadResponse struct {
Templated bool `json:"templated"`
}
// Download will get specified data from Yandex.Disk.
func (c *Client) Download(remotePath string) (io.ReadCloser, error) { //io.Writer
// Download will get specified data from Yandex.Disk supplying the extra headers
func (c *Client) Download(remotePath string, headers map[string]string) (io.ReadCloser, error) { //io.Writer
ur, err := c.DownloadRequest(remotePath)
if err != nil {
return nil, err
}
return c.PerformDownload(ur.HRef)
return c.PerformDownload(ur.HRef, headers)
}
// DownloadRequest will make an download request and return a URL to download data to.