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
+4 -3
View File
@@ -775,14 +775,15 @@ func (o *Object) Storable() bool {
}
// Open an object for read
func (o *Object) Open() (in io.ReadCloser, err error) {
func (o *Object) Open(options ...fs.OpenOption) (in io.ReadCloser, err error) {
if o.id == "" {
return nil, errors.New("can't download - no id")
}
var resp *http.Response
opts := rest.Opts{
Method: "GET",
Path: "/drive/items/" + o.id + "/content",
Method: "GET",
Path: "/drive/items/" + o.id + "/content",
Options: options,
}
err = o.fs.pacer.Call(func() (bool, error) {
resp, err = o.fs.srv.Call(&opts)