lotus/stores/interface.go

36 lines
1.1 KiB
Go
Raw Normal View History

2020-03-23 11:40:02 +00:00
package stores
import (
"context"
2020-07-08 14:58:09 +00:00
"github.com/filecoin-project/sector-storage/fsutil"
2020-03-23 11:40:02 +00:00
"github.com/filecoin-project/specs-actors/actors/abi"
)
2020-07-06 14:13:42 +00:00
type PathType string
2020-05-26 08:25:29 +00:00
const (
2020-08-04 14:20:59 +00:00
PathStorage PathType = "storage"
PathSealing PathType = "sealing"
)
type AcquireMode string
2020-05-26 08:25:29 +00:00
const (
2020-08-04 14:20:59 +00:00
AcquireMove AcquireMode = "move"
AcquireCopy AcquireMode = "copy"
)
2020-03-23 11:40:02 +00:00
type Store interface {
2020-06-15 12:32:17 +00:00
AcquireSector(ctx context.Context, s abi.SectorID, spt abi.RegisteredSealProof, existing SectorFileType, allocate SectorFileType, sealing PathType, op AcquireMode) (paths SectorPaths, stores SectorPaths, err error)
2020-05-13 18:45:14 +00:00
Remove(ctx context.Context, s abi.SectorID, types SectorFileType, force bool) error
// like remove, but doesn't remove the primary sector copy, nor the last
// non-primary copy if there no primary copies
RemoveCopies(ctx context.Context, s abi.SectorID, types SectorFileType) error
// move sectors into storage
2020-06-15 12:32:17 +00:00
MoveStorage(ctx context.Context, s abi.SectorID, spt abi.RegisteredSealProof, types SectorFileType) error
2020-07-08 14:58:09 +00:00
FsStat(ctx context.Context, id ID) (fsutil.FsStat, error)
}