fs: add RangeSeeker interface
This commit is contained in:
parent
334bf49d30
commit
a647c54888
1 changed files with 13 additions and 0 deletions
13
fs/fs.go
13
fs/fs.go
|
@ -672,6 +672,19 @@ type ListRer interface {
|
||||||
ListR(dir string, callback ListRCallback) error
|
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
|
// ObjectsChan is a channel of Objects
|
||||||
type ObjectsChan chan Object
|
type ObjectsChan chan Object
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue