badger

package module
v0.0.0-...-fb775b6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 26, 2024 License: AGPL-3.0 Imports: 15 Imported by: 1

README

This repository contains an implementation of storage.BlobStore of the Storj storagenodes.

This is just an experiment. It's slower than the default file-based one, and if you don't know what is it, you probably don't need it anyway.

Limitations:

  • Some parts are not yet implemented
  • Trash functionality is definitelly not implemented
  • Size calculation is 'estimation' based

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewReader

func NewReader(db *badger.DB, ref blobstore.BlobRef) (blobstore.BlobReader, error)

func NewWriter

func NewWriter(db *badger.DB, ref blobstore.BlobRef) *writer

Types

type BlobInfo

type BlobInfo struct {
	// contains filtered or unexported fields
}

func (BlobInfo) BlobRef

func (i BlobInfo) BlobRef() blobstore.BlobRef

func (BlobInfo) FullPath

func (i BlobInfo) FullPath(ctx context.Context) (string, error)

func (BlobInfo) Stat

func (BlobInfo) StorageFormatVersion

func (i BlobInfo) StorageFormatVersion() blobstore.FormatVersion

type BlobStore

type BlobStore struct {
	// contains filtered or unexported fields
}

func NewBlobStore

func NewBlobStore(dir string) (*BlobStore, error)

func (*BlobStore) CheckWritability

func (b *BlobStore) CheckWritability(ctx context.Context) error

func (*BlobStore) Close

func (b *BlobStore) Close() error

func (*BlobStore) Create

func (*BlobStore) CreateVerificationFile

func (b *BlobStore) CreateVerificationFile(ctx context.Context, id storj.NodeID) error

func (*BlobStore) Delete

func (b *BlobStore) Delete(ctx context.Context, ref blobstore.BlobRef) error

func (*BlobStore) DeleteNamespace

func (b *BlobStore) DeleteNamespace(ctx context.Context, ref []byte) (err error)

func (*BlobStore) DeleteTrashNamespace

func (b *BlobStore) DeleteTrashNamespace(ctx context.Context, namespace []byte) (err error)

func (*BlobStore) DeleteWithStorageFormat

func (b *BlobStore) DeleteWithStorageFormat(ctx context.Context, ref blobstore.BlobRef, formatVer blobstore.FormatVersion) error

func (*BlobStore) DiskInfo

func (b *BlobStore) DiskInfo(ctx context.Context) (blobstore.DiskInfo, error)

func (*BlobStore) EmptyTrash

func (b *BlobStore) EmptyTrash(ctx context.Context, namespace []byte, trashedBefore time.Time) (int64, [][]byte, error)

func (*BlobStore) ListNamespaces

func (b *BlobStore) ListNamespaces(ctx context.Context) ([][]byte, error)

func (*BlobStore) Open

func (*BlobStore) OpenWithStorageFormat

func (b *BlobStore) OpenWithStorageFormat(ctx context.Context, ref blobstore.BlobRef, formatVer blobstore.FormatVersion) (blobstore.BlobReader, error)

func (*BlobStore) RestoreTrash

func (b *BlobStore) RestoreTrash(ctx context.Context, namespace []byte) ([][]byte, error)

func (*BlobStore) SpaceUsedForBlobs

func (b *BlobStore) SpaceUsedForBlobs(ctx context.Context) (int64, error)

func (*BlobStore) SpaceUsedForBlobsInNamespace

func (b *BlobStore) SpaceUsedForBlobsInNamespace(ctx context.Context, namespace []byte) (int64, error)

func (*BlobStore) SpaceUsedForTrash

func (b *BlobStore) SpaceUsedForTrash(ctx context.Context) (int64, error)

func (*BlobStore) Stat

func (*BlobStore) StatWithStorageFormat

func (b *BlobStore) StatWithStorageFormat(ctx context.Context, ref blobstore.BlobRef, formatVer blobstore.FormatVersion) (blobstore.BlobInfo, error)

func (*BlobStore) Trash

func (b *BlobStore) Trash(ctx context.Context, ref blobstore.BlobRef, timestamp time.Time) error

func (*BlobStore) TryRestoreTrashBlob

func (b *BlobStore) TryRestoreTrashBlob(ctx context.Context, ref blobstore.BlobRef) error

func (*BlobStore) VerifyStorageDir

func (b *BlobStore) VerifyStorageDir(ctx context.Context, id storj.NodeID) error

func (*BlobStore) WalkNamespace

func (b *BlobStore) WalkNamespace(ctx context.Context, namespace []byte, startFromPrefix string, walkFunc func(blobstore.BlobInfo) error) error

type DiskInfo

type DiskInfo struct {
	ID             string
	AvailableSpace int64
}

DiskInfo contains statistics about this dir.

type FileInfo

type FileInfo struct {
	// contains filtered or unexported fields
}

func (FileInfo) ModTime

func (f FileInfo) ModTime() time.Time

func (FileInfo) Name

func (f FileInfo) Name() string

func (FileInfo) Size

func (f FileInfo) Size() int64

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL