Documentation ¶
Index ¶
- func NewCachedStatBlobStore(log *zap.Logger, cache Cache, delegate blobstore.Blobs) blobstore.Blobs
- type BadgerCache
- func (b *BadgerCache) Close() error
- func (b *BadgerCache) Delete(ctx context.Context, namespace []byte, key []byte) error
- func (b *BadgerCache) Get(ctx context.Context, namespace []byte, key []byte) (blobstore.FileInfo, bool, error)
- func (b *BadgerCache) Set(ctx context.Context, namespace []byte, key []byte, value blobstore.FileInfo) error
- type BlobInfo
- type Cache
- type CachedStatBlobstore
- func (s *CachedStatBlobstore) Delete(ctx context.Context, ref blobstore.BlobRef) error
- func (s *CachedStatBlobstore) DeleteWithStorageFormat(ctx context.Context, ref blobstore.BlobRef, formatVer blobstore.FormatVersion, ...) error
- func (s *CachedStatBlobstore) EmptyTrash(ctx context.Context, namespace []byte, trashedBefore time.Time) (int64, [][]byte, error)
- func (s *CachedStatBlobstore) Stat(ctx context.Context, ref blobstore.BlobRef) (blobstore.BlobInfo, error)
- func (s *CachedStatBlobstore) StatWithStorageFormat(ctx context.Context, ref blobstore.BlobRef, formatVer blobstore.FormatVersion) (blobstore.BlobInfo, error)
- func (s *CachedStatBlobstore) WalkNamespace(ctx context.Context, namespace []byte, skipPrefixFn blobstore.SkipPrefixFn, ...) error
- type FileInfo
- type Lie
- func (l Lie) Close() error
- func (l Lie) Delete(ctx context.Context, namespace []byte, key []byte) error
- func (l Lie) Get(ctx context.Context, namespace []byte, key []byte) (blobstore.FileInfo, bool, error)
- func (l Lie) Set(ctx context.Context, namespace []byte, key []byte, value blobstore.FileInfo) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BadgerCache ¶
type BadgerCache struct {
// contains filtered or unexported fields
}
BadgerCache implements Cache with saving file size / mod time to badger database.
func NewBadgerCache ¶
func NewBadgerCache(log *zap.Logger, dir string) (*BadgerCache, error)
NewBadgerCache creates a new BadgerCache.
type Cache ¶
type Cache interface { Get(ctx context.Context, namespace []byte, key []byte) (blobstore.FileInfo, bool, error) Set(ctx context.Context, namespace []byte, key []byte, value blobstore.FileInfo) error Delete(ctx context.Context, namespace []byte, key []byte) error Close() error }
Cache can store file metadata (size/mod time) and make it available (quickly).
type CachedStatBlobstore ¶
CachedStatBlobstore implements a blob store, but also manages an external cache for file metadata.
func (*CachedStatBlobstore) DeleteWithStorageFormat ¶
func (s *CachedStatBlobstore) DeleteWithStorageFormat(ctx context.Context, ref blobstore.BlobRef, formatVer blobstore.FormatVersion, sizeHint int64) error
DeleteWithStorageFormat implements blobstore.Blobs.
func (*CachedStatBlobstore) EmptyTrash ¶
func (s *CachedStatBlobstore) EmptyTrash(ctx context.Context, namespace []byte, trashedBefore time.Time) (int64, [][]byte, error)
EmptyTrash implements blobstore.Blobs.
func (*CachedStatBlobstore) Stat ¶
func (s *CachedStatBlobstore) Stat(ctx context.Context, ref blobstore.BlobRef) (blobstore.BlobInfo, error)
Stat implements blobstore.Blobs.
func (*CachedStatBlobstore) StatWithStorageFormat ¶
func (s *CachedStatBlobstore) StatWithStorageFormat(ctx context.Context, ref blobstore.BlobRef, formatVer blobstore.FormatVersion) (blobstore.BlobInfo, error)
StatWithStorageFormat implements blobstore.Blobs.
func (*CachedStatBlobstore) WalkNamespace ¶
func (s *CachedStatBlobstore) WalkNamespace(ctx context.Context, namespace []byte, skipPrefixFn blobstore.SkipPrefixFn, walkFunc func(blobstore.BlobInfo) error) error
WalkNamespace implements blobstore.Blobs.
type FileInfo ¶
type FileInfo struct {
// contains filtered or unexported fields
}
FileInfo is a simple implementation of blobstore.FileInfo.
type Lie ¶
type Lie struct { }
Lie is a cache implementation with returns with fake values. Do not use in production. Only for performance testing.