From 468a4849c474573772111dfd3a6da1559677dbde Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Thu, 24 Mar 2011 19:20:47 -0700 Subject: [PATCH] add StreamingFetcher interface --- lib/go/camli/blobref/fetcher.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/go/camli/blobref/fetcher.go b/lib/go/camli/blobref/fetcher.go index ce3eaf66d..9fbeafe42 100644 --- a/lib/go/camli/blobref/fetcher.go +++ b/lib/go/camli/blobref/fetcher.go @@ -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} }