storagemanager

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2020 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound is the error that happens when a sector data is not found
	ErrNotFound = errors.New("not found")
)

Functions

This section is empty.

Types

type StorageManager

type StorageManager interface {
	Start() error
	Close() error
	// Functions for download and storage responsibilities
	AddSectorBatch(sectorRoots []common.Hash) error
	AddSector(sectorRoot common.Hash, sectorData []byte) error
	DeleteSector(sectorRoot common.Hash) error
	DeleteSectorBatch(sectorRoots []common.Hash) error
	ReadSector(sectorRoot common.Hash) ([]byte, error)
	// Functions from user calls
	AddStorageFolder(path string, size uint64) error
	DeleteFolder(folderPath string) error
	ResizeFolder(folderPath string, size uint64) error
	// Status check
	Folders() []storage.HostFolder
	AvailableSpace() storage.HostSpace
}

StorageManager is the interface to manager storage which will be provided to upper function calls. Supported methods are mutually exclusive

func New

func New(persistDir string) (sm StorageManager, err error)

New creates a new storage manager with no disruptor

Jump to

Keyboard shortcuts

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