filestore

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2020 License: Apache-2.0, MIT Imports: 6 Imported by: 22

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File interface {
	Path() Path
	OsPath() OsPath
	Size() int64

	io.Closer
	io.Reader
	io.Writer
	io.Seeker
}

File is a wrapper around an os file

type FileStore

type FileStore interface {
	Open(p Path) (File, error)
	Create(p Path) (File, error)
	Store(p Path, f File) (Path, error)
	Delete(p Path) error

	CreateTemp() (File, error)
}

FileStore is an abstract filestore, used for storing temporary file data when handing off a deal to the Storage Mining module. Files are created by the storage market module, their path is given to the storage mining module when AddPiece is called. The Storage Mining module then reads from them from the FileStore, and deletes them once they have been sealed in a sector

func NewLocalFileStore

func NewLocalFileStore(basedirectory OsPath) (FileStore, error)

NewLocalFileStore creates a filestore mounted on a given local directory path

type OsPath

type OsPath string

OsPath represents a path that can be located on the operating system with standard os.File operations

type Path

type Path string

Path represents an abstract path to a file

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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