mirror of
https://github.com/kopia/kopia.git
synced 2026-01-27 07:48:06 -05:00
30 lines
751 B
Go
30 lines
751 B
Go
package block
|
|
|
|
import (
|
|
"bytes"
|
|
"context"
|
|
"time"
|
|
|
|
"github.com/kopia/kopia/storage"
|
|
)
|
|
|
|
type nullBlockCache struct {
|
|
st storage.Storage
|
|
}
|
|
|
|
func (c nullBlockCache) getBlock(ctx context.Context, cacheKey string, blockID PhysicalBlockID, offset, length int64) ([]byte, error) {
|
|
return c.st.GetBlock(ctx, string(blockID), offset, length)
|
|
}
|
|
|
|
func (c nullBlockCache) putBlock(ctx context.Context, blockID PhysicalBlockID, data []byte) error {
|
|
return c.st.PutBlock(ctx, string(blockID), bytes.NewReader(data))
|
|
}
|
|
|
|
func (c nullBlockCache) listIndexBlocks(ctx context.Context, full bool, extraTime time.Duration) ([]IndexInfo, error) {
|
|
return listIndexBlocksFromStorage(ctx, c.st, full, extraTime)
|
|
}
|
|
|
|
func (c nullBlockCache) close() error {
|
|
return nil
|
|
}
|