Versions in this module Expand all Collapse all v1 v1.0.0 Aug 15, 2021 Changes in this version + const MetaFile + var CopyBuf = 1 << 20 + var FetchTempSubdir = "fetching" + var HeartbeatInterval = 10 * time.Second + var SkippedHeartbeatThresh = HeartbeatInterval * 5 + type Decl struct + type FetchHandler struct + func (handler *FetchHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) + type HealthReport struct + Err string + Stat fsutil.FsStat + type ID string + type Index struct + func NewIndex() *Index + func (i *Index) FindSector(id abi.SectorID, typ storiface.SectorFileType) ([]ID, error) + func (i *Index) StorageAttach(ctx context.Context, si StorageInfo, st fsutil.FsStat) error + func (i *Index) StorageBestAlloc(ctx context.Context, allocate storiface.SectorFileType, ssize abi.SectorSize, ...) ([]StorageInfo, error) + func (i *Index) StorageDeclareSector(ctx context.Context, storageID ID, s abi.SectorID, ft storiface.SectorFileType, ...) error + func (i *Index) StorageDropSector(ctx context.Context, storageID ID, s abi.SectorID, ft storiface.SectorFileType) error + func (i *Index) StorageFindSector(ctx context.Context, s abi.SectorID, ft storiface.SectorFileType, ...) ([]SectorStorageInfo, error) + func (i *Index) StorageInfo(ctx context.Context, id ID) (StorageInfo, error) + func (i *Index) StorageList(ctx context.Context) (map[ID][]Decl, error) + func (i *Index) StorageReportHealth(ctx context.Context, id ID, report HealthReport) error + func (i Index) StorageLock(ctx context.Context, sector abi.SectorID, read storiface.SectorFileType, ...) error + func (i Index) StorageTryLock(ctx context.Context, sector abi.SectorID, read storiface.SectorFileType, ...) (bool, error) + type Local struct + func NewLocal(ctx context.Context, ls LocalStorage, index SectorIndex, urls []string) (*Local, error) + func (st *Local) AcquireSector(ctx context.Context, sid storage.SectorRef, existing storiface.SectorFileType, ...) (storiface.SectorPaths, storiface.SectorPaths, error) + func (st *Local) FsStat(ctx context.Context, id ID) (fsutil.FsStat, error) + func (st *Local) Local(ctx context.Context) ([]StoragePath, error) + func (st *Local) MoveStorage(ctx context.Context, s storage.SectorRef, types storiface.SectorFileType) error + func (st *Local) OpenPath(ctx context.Context, p string) error + func (st *Local) Redeclare(ctx context.Context) error + func (st *Local) Remove(ctx context.Context, sid abi.SectorID, typ storiface.SectorFileType, ...) error + func (st *Local) RemoveCopies(ctx context.Context, sid abi.SectorID, typ storiface.SectorFileType) error + func (st *Local) Reserve(ctx context.Context, sid storage.SectorRef, ft storiface.SectorFileType, ...) (func(), error) + type LocalPath struct + Path string + type LocalStorage interface + DiskUsage func(path string) (int64, error) + GetStorage func() (StorageConfig, error) + SetStorage func(func(*StorageConfig)) error + Stat func(path string) (fsutil.FsStat, error) + type LocalStorageMeta struct + CanSeal bool + CanStore bool + ID ID + MaxStorage uint64 + Weight uint64 + type Remote struct + func NewRemote(local *Local, index SectorIndex, auth http.Header, fetchLimit int) *Remote + func (r *Remote) AcquireSector(ctx context.Context, s storage.SectorRef, existing storiface.SectorFileType, ...) (storiface.SectorPaths, storiface.SectorPaths, error) + func (r *Remote) FsStat(ctx context.Context, id ID) (fsutil.FsStat, error) + func (r *Remote) MoveStorage(ctx context.Context, s storage.SectorRef, types storiface.SectorFileType) error + func (r *Remote) Remove(ctx context.Context, sid abi.SectorID, typ storiface.SectorFileType, ...) error + func (r *Remote) RemoveCopies(ctx context.Context, s abi.SectorID, types storiface.SectorFileType) error + type SectorIndex interface + StorageAttach func(context.Context, StorageInfo, fsutil.FsStat) error + StorageBestAlloc func(ctx context.Context, allocate storiface.SectorFileType, ssize abi.SectorSize, ...) ([]StorageInfo, error) + StorageDeclareSector func(ctx context.Context, storageID ID, s abi.SectorID, ft storiface.SectorFileType, ...) error + StorageDropSector func(ctx context.Context, storageID ID, s abi.SectorID, ft storiface.SectorFileType) error + StorageFindSector func(ctx context.Context, sector abi.SectorID, ft storiface.SectorFileType, ...) ([]SectorStorageInfo, error) + StorageInfo func(context.Context, ID) (StorageInfo, error) + StorageLock func(ctx context.Context, sector abi.SectorID, read storiface.SectorFileType, ...) error + StorageReportHealth func(context.Context, ID, HealthReport) error + StorageTryLock func(ctx context.Context, sector abi.SectorID, read storiface.SectorFileType, ...) (bool, error) + type SectorStorageInfo struct + CanSeal bool + CanStore bool + ID ID + Primary bool + URLs []string + Weight uint64 + type StorageConfig struct + StoragePaths []LocalPath + type StorageInfo struct + CanSeal bool + CanStore bool + ID ID + MaxStorage uint64 + URLs []string + Weight uint64 + type StoragePath struct + CanSeal bool + CanStore bool + ID ID + LocalPath string + Weight uint64 + type Store interface + AcquireSector func(ctx context.Context, s storage.SectorRef, existing storiface.SectorFileType, ...) (paths storiface.SectorPaths, stores storiface.SectorPaths, err error) + FsStat func(ctx context.Context, id ID) (fsutil.FsStat, error) + MoveStorage func(ctx context.Context, s storage.SectorRef, types storiface.SectorFileType) error + Remove func(ctx context.Context, s abi.SectorID, types storiface.SectorFileType, ...) error + RemoveCopies func(ctx context.Context, s abi.SectorID, types storiface.SectorFileType) error