storage

package
v0.0.0-...-d0cb44a Latest Latest
Warning

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

Go to latest
Published: May 27, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HealInterval = 5 * time.Minute
	MinReplicas  = 3
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BadgerStore

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

func NewBadgerStore

func NewBadgerStore(dir string) (*BadgerStore, error)

func (*BadgerStore) Close

func (s *BadgerStore) Close() error

func (*BadgerStore) DeleteObject

func (s *BadgerStore) DeleteObject(bucket, key string) error

func (*BadgerStore) DeleteObjectVersion

func (s *BadgerStore) DeleteObjectVersion(ctx context.Context, bucket, key, versionID string) error

func (*BadgerStore) GetObject

func (s *BadgerStore) GetObject(bucket, key string) ([]byte, error)

func (*BadgerStore) PurgeDeletedObjects

func (s *BadgerStore) PurgeDeletedObjects(ctx context.Context, retention time.Duration) error

func (*BadgerStore) PutObject

func (s *BadgerStore) PutObject(bucket, key string, data []byte) error

func (*BadgerStore) SelfHeal

func (s *BadgerStore) SelfHeal(ctx context.Context) error

func (*BadgerStore) SoftDeleteObject

func (s *BadgerStore) SoftDeleteObject(ctx context.Context, bucket, key string) error

func (*BadgerStore) StoreDAG

func (s *BadgerStore) StoreDAG(ctx context.Context, node *dag.MerkleNode) error

type PostgresStore

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

func NewPostgresStore

func NewPostgresStore(connStr string) (*PostgresStore, error)

func (*PostgresStore) Migrate

func (s *PostgresStore) Migrate() error

type QuotaManager

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

func NewQuotaManager

func NewQuotaManager(store *BadgerStore) *QuotaManager

func (*QuotaManager) CheckQuota

func (q *QuotaManager) CheckQuota(ctx context.Context, bucket string, size int64) error

type Replicator

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

func NewReplicator

func NewReplicator(store *BadgerStore, dht *p2p.DHTOperations) *Replicator

func (*Replicator) EnsureReplicas

func (r *Replicator) EnsureReplicas(ctx context.Context) error

func (*Replicator) Replicate

func (r *Replicator) Replicate(ctx context.Context, bucket, key string) error

type StorageManager

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

func NewStorageManager

func NewStorageManager(store *BadgerStore) *StorageManager

Jump to

Keyboard shortcuts

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