stream

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Error = errs.Class("stream")

Error is the errs class of stream errors.

Functions

This section is empty.

Types

type Download

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

Download implements Reader, Seeker and Closer for reading from stream.

func NewDownload

func NewDownload(ctx context.Context, info metaclient.DownloadInfo, streams *streams.Store) *Download

NewDownload creates new stream download.

func NewDownloadRange

func NewDownloadRange(ctx context.Context, info metaclient.DownloadInfo, streams *streams.Store, start, length int64) *Download

NewDownloadRange creates new stream range download with range from start to start+length.

func (*Download) Close

func (download *Download) Close() error

Close closes the stream and releases the underlying resources.

func (*Download) Read

func (download *Download) Read(data []byte) (n int, err error)

Read reads up to len(data) bytes into data.

If this is the first call it will read from the beginning of the stream. Use Seek to change the current offset for the next Read call.

See io.Reader for more details.

type PartUpload added in v1.6.0

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

PartUpload implements Writer and Closer for writing to part.

func NewUploadPart added in v1.6.0

func NewUploadPart(ctx context.Context, bucket, key string, streamID storj.StreamID, partNumber uint32, etag streams.ETag, streamsStore *streams.Store) *PartUpload

NewUploadPart creates new part upload.

func (*PartUpload) Abort added in v1.6.0

func (upload *PartUpload) Abort() error

Abort closes the stream with an error so that it does not successfully commit and releases the underlying resources.

func (*PartUpload) Close added in v1.6.0

func (upload *PartUpload) Close() error

Close closes the stream and releases the underlying resources.

func (*PartUpload) Part added in v1.6.0

func (upload *PartUpload) Part() *streams.Part

Part returns the part metadata.

Will return nil if the upload is still in progress.

func (*PartUpload) Write added in v1.6.0

func (upload *PartUpload) Write(data []byte) (n int, err error)

Write writes len(data) bytes from data to the underlying data stream.

See io.Writer for more details.

type Upload

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

Upload implements Writer and Closer for writing to stream.

func NewUpload

func NewUpload(ctx context.Context, stream *metaclient.MutableStream, streamsStore *streams.Store) *Upload

NewUpload creates new stream upload.

func (*Upload) Abort added in v1.2.0

func (upload *Upload) Abort() error

Abort closes the stream with an error so that it does not successfully commit and releases the underlying resources.

func (*Upload) Close

func (upload *Upload) Close() error

Close closes the stream and releases the underlying resources.

func (*Upload) Meta

func (upload *Upload) Meta() *streams.Meta

Meta returns the metadata of the uploaded object.

Will return nil if the upload is still in progress.

func (*Upload) Write

func (upload *Upload) Write(data []byte) (n int, err error)

Write writes len(data) bytes from data to the underlying data stream.

See io.Writer for more details.

Jump to

Keyboard shortcuts

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