segments

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Error = errs.Class("segment error")

Error is the errs class of standard segment errors.

Functions

This section is empty.

Types

type SizedReader

type SizedReader struct {
	// contains filtered or unexported fields
}

SizedReader allows to check the total number of bytes read so far.

func SizeReader

func SizeReader(r io.Reader) *SizedReader

SizeReader create a new instance of SizedReader.

func (*SizedReader) Read

func (r *SizedReader) Read(p []byte) (n int, err error)

Read implements io.Reader.Read.

func (*SizedReader) Size

func (r *SizedReader) Size() int64

Size returns the total number of bytes read so far.

type Store

type Store interface {
	// Ranger creates a ranger for downloading erasure codes from piece store nodes.
	Ranger(ctx context.Context, info storj.SegmentDownloadInfo, limits []*pb.AddressedOrderLimit, objectRS storj.RedundancyScheme) (ranger.Ranger, error)
	Put(ctx context.Context, data io.Reader, expiration time.Time, limits []*pb.AddressedOrderLimit, piecePrivateKey storj.PiecePrivateKey, rs eestream.RedundancyStrategy) (_ []*pb.SegmentPieceUploadResult, size int64, err error)
}

Store for segments.

func NewSegmentStore

func NewSegmentStore(metainfo *metainfo.Client, ec ecclient.Client) Store

NewSegmentStore creates a new instance of segmentStore.

Jump to

Keyboard shortcuts

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