filestore

package
v0.0.0-...-f311442 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: Apache-2.0, MIT Imports: 6 Imported by: 0

README

filestore

The filestore module is a simple wrapper for os.File. It is used by pieceio, retrievialmarket, and storagemarket.

Installation

go get github.com/filecoin-project/go-fil-markets/filestore

FileStore

FileStore is the primary export of this module.

Usage

To create a new local filestore mounted on a given local directory path, use:

package filestore

func NewLocalFileStore(basedirectory OsPath) (FileStore, error) 

A FileStore provides the following functions:

Please the tests for more information about expected behavior.

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(baseDir 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