Files
kopia/repo/content/content_cache_passthrough.go
Jarek Kowalski 35d0f31c0d huge: replaced the use of allocated byte slices with populating gather.WriteBuffer in the repository (#1244)
This helps recycle buffers more efficiently during snapshots.
Also, improved memory tracking, enabled profiling flags and added pprof
by default.
2021-08-20 08:45:10 -07:00

21 lines
548 B
Go

package content
import (
"context"
"github.com/kopia/kopia/internal/gather"
"github.com/kopia/kopia/repo/blob"
)
// passthroughContentCache is a contentCache which does no caching.
type passthroughContentCache struct {
st blob.Storage
}
func (c passthroughContentCache) close(ctx context.Context) {}
func (c passthroughContentCache) getContent(ctx context.Context, cacheKey cacheKey, blobID blob.ID, offset, length int64, output *gather.WriteBuffer) error {
// nolint:wrapcheck
return c.st.GetBlob(ctx, blobID, offset, length, output)
}