| 175 | } |
| 176 | |
| 177 | func (sto *Storage) SubFetch(ctx context.Context, ref blob.Ref, offset, length int64) (io.ReadCloser, error) { |
| 178 | if sf, ok := sto.cache.(blob.SubFetcher); ok { |
| 179 | rc, err := sf.SubFetch(ctx, ref, offset, length) |
| 180 | if err == nil { |
| 181 | return rc, nil |
| 182 | } |
| 183 | if err != os.ErrNotExist && err != blob.ErrUnimplemented { |
| 184 | log.Printf("proxycache: error fetching from cache %T: %v", sto.cache, err) |
| 185 | } |
| 186 | } |
| 187 | if sf, ok := sto.origin.(blob.SubFetcher); ok { |
| 188 | return sf.SubFetch(ctx, ref, offset, length) |
| 189 | } |
| 190 | return nil, blob.ErrUnimplemented |
| 191 | } |
| 192 | |
| 193 | func (sto *Storage) StatBlobs(ctx context.Context, blobs []blob.Ref, fn func(blob.SizedRef) error) error { |
| 194 | need := map[blob.Ref]bool{} |