storagemanager

package
v1.7.5 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: Apache-2.0, MIT Imports: 11 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoSpaceLeft = errors.New("no space left")

ErrNoSpaceLeft indicates that there is insufficient storage to accept a deal

View Source
var (
	StagingAreaDirName = "incoming"
)

Functions

func New

func New(cfg Config) func(lr lotus_repo.LockedRepo, sqldb *sql.DB) (*StorageManager, error)

Types

type Config

type Config struct {
	MaxStagingDealsBytes          uint64
	MaxStagingDealsPercentPerHost uint64
}

type StorageManager

type StorageManager struct {
	Cfg                Config
	StagingAreaDirPath string
	// contains filtered or unexported fields
}

func (*StorageManager) DownloadFilePath

func (m *StorageManager) DownloadFilePath(dealUuid uuid.UUID) (string, error)

DownloadFilePath creates a file in the download staging area for the deal with the given uuid

func (*StorageManager) Free

func (m *StorageManager) Free(ctx context.Context) (uint64, error)

Free

func (*StorageManager) Tag

func (m *StorageManager) Tag(ctx context.Context, dealUuid uuid.UUID, size uint64, host string) error

Tags storage space for the deal. If there is not enough space left, returns ErrNoSpaceLeft.

func (*StorageManager) TotalTagged

func (m *StorageManager) TotalTagged(ctx context.Context) (uint64, error)

func (*StorageManager) TotalTaggedForHost added in v1.4.0

func (m *StorageManager) TotalTaggedForHost(ctx context.Context, host string) (uint64, error)

func (*StorageManager) Untag

func (m *StorageManager) Untag(ctx context.Context, dealUuid uuid.UUID) error

Untag

Jump to

Keyboard shortcuts

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