1
mirror of https://github.com/rclone/rclone synced 2024-11-29 07:55:12 +01:00

fs: add RangeSeeker interface

This commit is contained in:
Fabian Möller 2018-01-21 18:33:58 +01:00 committed by Nick Craig-Wood
parent 334bf49d30
commit a647c54888

View File

@ -672,6 +672,19 @@ type ListRer interface {
ListR(dir string, callback ListRCallback) error
}
// RangeSeeker is the interface that wraps the RangeSeek method.
//
// Some of the returns from Object.Open() may optionally implement
// this method for efficiency purposes.
type RangeSeeker interface {
// RangeSeek behaves like a call to Seek(offset int64, whence
// int) with the output wrapped in an io.LimitedReader
// limiting the total length to limit.
//
// RangeSeek with a limit of < 0 is equivalent to a regular Seek.
RangeSeek(offset int64, whence int, length int64) (int64, error)
}
// ObjectsChan is a channel of Objects
type ObjectsChan chan Object