mirror of
https://github.com/kopia/kopia.git
synced 2026-03-13 11:46:55 -04:00
36 lines
869 B
Go
36 lines
869 B
Go
package block
|
|
|
|
import (
|
|
"bytes"
|
|
"context"
|
|
|
|
"github.com/kopia/kopia/storage"
|
|
)
|
|
|
|
type nullBlockCache struct {
|
|
st storage.Storage
|
|
}
|
|
|
|
func (c nullBlockCache) getBlock(ctx context.Context, cacheKey string, blockID string, offset, length int64) ([]byte, error) {
|
|
return c.st.GetBlock(ctx, string(blockID), offset, length)
|
|
}
|
|
|
|
func (c nullBlockCache) putBlock(ctx context.Context, blockID string, data []byte) error {
|
|
return c.st.PutBlock(ctx, string(blockID), bytes.NewReader(data))
|
|
}
|
|
|
|
func (c nullBlockCache) listIndexBlocks(ctx context.Context) ([]IndexInfo, error) {
|
|
return listIndexBlocksFromStorage(ctx, c.st)
|
|
}
|
|
|
|
func (c nullBlockCache) deleteListCache(ctx context.Context) {
|
|
}
|
|
|
|
func (c nullBlockCache) deleteBlock(ctx context.Context, blockID string) error {
|
|
return c.st.DeleteBlock(ctx, string(blockID))
|
|
}
|
|
|
|
func (c nullBlockCache) close() error {
|
|
return nil
|
|
}
|