MCPcopy
hub / github.com/perkeep/perkeep / Fetcher

Interface Fetcher

pkg/blob/fetcher.go:35–50  ·  view source on GitHub ↗

Fetcher is the minimal interface for retrieving a blob from storage. The full storage interface is blobserver.Storage.

Source from the content-addressed store, hash-verified

33// Fetcher is the minimal interface for retrieving a blob from storage.
34// The full storage interface is blobserver.Storage.
35type Fetcher interface {
36 // Fetch returns a blob. If the blob is not found then
37 // os.ErrNotExist should be returned for the error (not a wrapped
38 // error with a ErrNotExist inside)
39 //
40 // The contents are not guaranteed to match the digest of the
41 // provided Ref (e.g. when streamed over HTTP). Paranoid
42 // callers should verify them.
43 //
44 // The caller must close blob.
45 //
46 // The provided context is used until blob is closed and its
47 // cancellation should but may not necessarily cause reads from
48 // blob to fail with an error.
49 Fetch(context.Context, Ref) (blob io.ReadCloser, size uint32, err error)
50}
51
52// ErrUnimplemented is returned by optional interfaces when their
53// wrapped values don't implemented the optional interface.

Callers 17

fetchViaMethod · 0.65
FetchMethod · 0.65
FromFetcherFunction · 0.65
FetchMethod · 0.65
faultInMethod · 0.65
getNamedMethod · 0.65
FetchMethod · 0.65
TestIsolationFunction · 0.65
AddBlobMethod · 0.95
testReadDirFunction · 0.95
addBlobMethod · 0.80
TestArchiverFunction · 0.80

Implementers 15

Clientpkg/client/client.go
serialFetcherpkg/blob/fetcher.go
DirFetcherpkg/blob/fetcher.go
CachingFetcherpkg/cacher/cacher.go
NoImplStoragepkg/blobserver/noimpl.go
remoteStoragepkg/blobserver/remote/remote.go
storagepkg/blobserver/diskpacked/diskpacked.g
nstopkg/blobserver/namespace/ns.go
Storagepkg/blobserver/files/files.go
unionStoragepkg/blobserver/union/union.go
azureStoragepkg/blobserver/azure/azure.go
mongoStoragepkg/blobserver/mongo/mongo.go

Calls

no outgoing calls

Tested by

no test coverage detected