Documentation ¶
Index ¶
- Variables
- func New(cfg Config) func(lr lotus_repo.LockedRepo, sqldb *sql.DB) (*StorageManager, error)
- type Config
- type StorageManager
- func (m *StorageManager) DownloadFilePath(dealUuid uuid.UUID) (string, error)
- func (m *StorageManager) Free(ctx context.Context) (uint64, error)
- func (m *StorageManager) Tag(ctx context.Context, dealUuid uuid.UUID, size uint64, host string) error
- func (m *StorageManager) TotalTagged(ctx context.Context) (uint64, error)
- func (m *StorageManager) TotalTaggedForHost(ctx context.Context, host string) (uint64, error)
- func (m *StorageManager) Untag(ctx context.Context, dealUuid uuid.UUID) error
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 StorageManager ¶
type StorageManager struct { 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
Click to show internal directories.
Click to hide internal directories.