Documentation ¶
Index ¶
- Variables
- type DB
- type ExpiredInfo
- type Info
- type Reader
- type StorageStatus
- type Store
- func (store *Store) Delete(ctx context.Context, satellite storj.NodeID, pieceID storj.PieceID) (err error)
- func (store *Store) Reader(ctx context.Context, satellite storj.NodeID, pieceID storj.PieceID) (_ *Reader, err error)
- func (store *Store) StorageStatus(ctx context.Context) (_ StorageStatus, err error)
- func (store *Store) Writer(ctx context.Context, satellite storj.NodeID, pieceID storj.PieceID) (_ *Writer, err error)
- type Writer
Constants ¶
This section is empty.
Variables ¶
var ( // Error is the default error class. Error = errs.Class("pieces error") )
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 // DeleteFailed marks piece deletion from disk failed DeleteFailed(ctx context.Context, satelliteID storj.NodeID, pieceID storj.PieceID, failedAt time.Time) error // SpaceUsed calculates disk space used by all pieces SpaceUsed(ctx context.Context) (int64, error) // GetExpired gets orders that are expired and were created before some time GetExpired(ctx context.Context, expiredAt time.Time, limit int64) ([]ExpiredInfo, error) }
DB stores meta information about a piece, the actual piece is stored in storage.Blobs
type ExpiredInfo ¶ added in v0.11.0
ExpiredInfo is a fully namespaced piece id
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 reader that reads content from blob store.
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) (err error)
Delete deletes the specified piece.
func (*Store) Reader ¶
func (store *Store) Reader(ctx context.Context, satellite storj.NodeID, pieceID storj.PieceID) (_ *Reader, err error)
Reader returns a new piece reader.
func (*Store) StorageStatus ¶
func (store *Store) StorageStatus(ctx context.Context) (_ StorageStatus, err 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.