1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
16
17 package blobserver
18
19 import (
20 "context"
21 "errors"
22 "io"
23 "os"
24
25 "perkeep.org/pkg/blob"
26 )
27
28
29
30 type NoImplStorage struct{}
31
32 var _ Storage = NoImplStorage{}
33
34 func (NoImplStorage) Fetch(context.Context, blob.Ref) (file io.ReadCloser, size uint32, err error) {
35 return nil, 0, os.ErrNotExist
36 }
37
38 func (NoImplStorage) ReceiveBlob(context.Context, blob.Ref, io.Reader) (sb blob.SizedRef, err error) {
39 err = errors.New("ReceiveBlob not implemented")
40 return
41 }
42
43 func (NoImplStorage) StatBlobs(ctx context.Context, blobs []blob.Ref, fn func(blob.SizedRef) error) error {
44 return errors.New("Stat not implemented")
45 }
46
47 func (NoImplStorage) EnumerateBlobs(ctx context.Context, dest chan<- blob.SizedRef, after string, limit int) error {
48 close(dest)
49 return errors.New("EnumerateBlobs not implemented")
50 }
51
52 func (NoImplStorage) RemoveBlobs(ctx context.Context, blobs []blob.Ref) error {
53 return errors.New("Remove not implemented")
54 }