mirror of https://github.com/perkeep/perkeep.git
add StreamingFetcher interface
This commit is contained in:
parent
4b5380a8aa
commit
468a4849c4
|
@ -18,6 +18,7 @@ package blobref
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"path/filepath"
|
||||
)
|
||||
|
@ -29,6 +30,13 @@ type Fetcher interface {
|
|||
Fetch(*BlobRef) (file ReadSeekCloser, size int64, err os.Error)
|
||||
}
|
||||
|
||||
type StreamingFetcher interface {
|
||||
// Fetch returns a blob. If the blob is not found then
|
||||
// os.ENOENT should be returned for the error (not a wrapped
|
||||
// error with a ENOENT inside)
|
||||
FetchStreaming(*BlobRef) (file io.ReadCloser, size int64, err os.Error)
|
||||
}
|
||||
|
||||
func NewSerialFetcher(fetchers ...Fetcher) Fetcher {
|
||||
return &serialFetcher{fetchers}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue