Documentation ¶
Index ¶
- func DisableDeleteOnCancel(ctx context.Context) context.Context
- type EOFReader
- type Meta
- type Metadata
- type PeekThresholdReader
- type SizedReader
- type Store
- func (s *Store) Close() error
- func (s *Store) Delete(ctx context.Context, bucket, unencryptedKey string) (err error)
- func (s *Store) Get(ctx context.Context, bucket, unencryptedKey string, object storj.Object) (rr ranger.Ranger, err error)
- func (s *Store) Put(ctx context.Context, bucket, unencryptedKey string, data io.Reader, ...) (_ Meta, err error)
- func (s *Store) Ranger(ctx context.Context, info storj.SegmentDownloadInfo, ...) (rr ranger.Ranger, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DisableDeleteOnCancel ¶ added in v1.4.3
DisableDeleteOnCancel changes upload behavior to skip object cleanup when an upload is canceled. This is not recommended and may cause zombie segments. This function is a stop gap for one customer and will be removed soon. Buyer beware.
Types ¶
type EOFReader ¶
type EOFReader struct {
// contains filtered or unexported fields
}
EOFReader holds reader and status of EOF.
func NewEOFReader ¶
NewEOFReader keeps track of the state, has the internal reader reached EOF.
type PeekThresholdReader ¶ added in v1.0.6
type PeekThresholdReader struct {
// contains filtered or unexported fields
}
PeekThresholdReader allows a check to see if the size of a given reader exceeds the maximum inline segment size or not.
func NewPeekThresholdReader ¶ added in v1.0.6
func NewPeekThresholdReader(r io.Reader) (pt *PeekThresholdReader)
NewPeekThresholdReader creates a new instance of PeekThresholdReader.
func (*PeekThresholdReader) IsLargerThan ¶ added in v1.0.6
func (pt *PeekThresholdReader) IsLargerThan(thresholdSize int) (bool, error)
IsLargerThan returns a bool to determine whether a reader's size is larger than the given threshold or not.
type SizedReader ¶ added in v1.2.0
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 ¶ added in v1.2.0
func (r *SizedReader) Read(p []byte) (n int, err error)
Read implements io.Reader.Read.
func (*SizedReader) Size ¶ added in v1.2.0
func (r *SizedReader) Size() int64
Size returns the total number of bytes read so far.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is a store for streams. It implements typedStore as part of an ongoing migration to use typed paths. See the shim for the store that the rest of the world interacts with.
func NewStreamStore ¶
func NewStreamStore(metainfo *metainfo.Client, ec ecclient.Client, segmentSize int64, encStore *encryption.Store, encryptionParameters storj.EncryptionParameters, inlineThreshold int) (*Store, error)
NewStreamStore constructs a stream store.
func (*Store) Close ¶ added in v1.4.0
Close closes the underlying resources passed to the metainfo DB.
func (*Store) Get ¶
func (s *Store) Get(ctx context.Context, bucket, unencryptedKey string, object storj.Object) (rr ranger.Ranger, err error)
Get returns a ranger that knows what the overall size is (from l/<key>) and then returns the appropriate data from segments s0/<key>, s1/<key>, ..., l/<key>.
func (*Store) Put ¶
func (s *Store) Put(ctx context.Context, bucket, unencryptedKey string, data io.Reader, metadata Metadata, expiration time.Time) (_ Meta, err error)
Put breaks up data as it comes in into s.segmentSize length pieces, then store the first piece at s0/<key>, second piece at s1/<key>, and the *last* piece at l/<key>. Store the given metadata, along with the number of segments, in a new protobuf, in the metadata of l/<key>.
If there is an error, it cleans up any uploaded segment before returning.
func (*Store) Ranger ¶ added in v1.4.0
func (s *Store) Ranger( ctx context.Context, info storj.SegmentDownloadInfo, limits []*pb.AddressedOrderLimit, objectRS storj.RedundancyScheme, ) (rr ranger.Ranger, err error)
Ranger creates a ranger for downloading erasure codes from piece store nodes.