Documentation ¶
Index ¶
- Variables
- type DB
- type Info
- type Reader
- type StorageStatus
- type Store
- func (store *Store) Delete(ctx context.Context, satellite storj.NodeID, pieceID storj.PieceID) error
- func (store *Store) Reader(ctx context.Context, satellite storj.NodeID, pieceID storj.PieceID) (*Reader, error)
- func (store *Store) StorageStatus() (StorageStatus, error)
- func (store *Store) Writer(ctx context.Context, satellite storj.NodeID, pieceID storj.PieceID) (*Writer, error)
- type Writer
Constants ¶
This section is empty.
Variables ¶
var Error = errs.Class("pieces error")
Error is the default error class.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB interface { // Add inserts Info to the database. Add(context.Context, *Info) error // Get returns Info about a piece. Get(ctx context.Context, satelliteID storj.NodeID, pieceID storj.PieceID) (*Info, error) // Delete deletes Info about a piece. Delete(ctx context.Context, satelliteID storj.NodeID, pieceID storj.PieceID) error // SpaceUsed calculates disk space used by all pieces SpaceUsed(ctx context.Context) (int64, error) }
DB stores meta information about a piece, the actual piece is stored in storage.Blobs
type Info ¶
type Info struct { SatelliteID storj.NodeID PieceID storj.PieceID PieceSize int64 PieceExpiration *time.Time UplinkPieceHash *pb.PieceHash Uplink *identity.PeerIdentity }
Info contains all the information we need to know about a Piece to manage them.
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader implements a piece writer that writes content to blob store and calculates a hash.
func NewReader ¶
func NewReader(blob storage.BlobReader, bufferSize int) (*Reader, error)
NewReader creates a new reader for storage.BlobReader.
type StorageStatus ¶
StorageStatus contains information about the disk store is using.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store implements storing pieces onto a blob storage implementation.
func (*Store) Delete ¶
func (store *Store) Delete(ctx context.Context, satellite storj.NodeID, pieceID storj.PieceID) error
Delete deletes the specified piece.
func (*Store) Reader ¶
func (store *Store) Reader(ctx context.Context, satellite storj.NodeID, pieceID storj.PieceID) (*Reader, error)
Reader returns a new piece reader.
func (*Store) StorageStatus ¶
func (store *Store) StorageStatus() (StorageStatus, error)
StorageStatus returns information about the disk.
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer implements a piece writer that writes content to blob store and calculates a hash.
func NewWriter ¶
func NewWriter(blob storage.BlobWriter, bufferSize int) (*Writer, error)
NewWriter creates a new writer for storage.BlobWriter.