streams

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2020 License: MIT Imports: 20 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EOFReader

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

EOFReader holds reader and status of EOF.

func NewEOFReader

func NewEOFReader(r io.Reader) *EOFReader

NewEOFReader keeps track of the state, has the internal reader reached EOF.

func (*EOFReader) Read

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

type ListItem

type ListItem struct {
	Path     string
	Meta     Meta
	IsPrefix bool
}

ListItem is a single item in a listing.

type Meta

type Meta struct {
	Modified   time.Time
	Expiration time.Time
	Size       int64
	Data       []byte
}

Meta info about a stream.

type Metadata

type Metadata interface {
	Metadata() ([]byte, error)
}

Metadata interface returns the latest metadata for an object.

type Path

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

Path is a representation of an object path within a bucket.

func ParsePath

func ParsePath(raw storj.Path) Path

ParsePath returns a new Path with the given raw bytes.

func (Path) Bucket

func (p Path) Bucket() string

Bucket returns the bucket part of the path.

func (Path) Raw

func (p Path) Raw() []byte

Raw returns the raw data in the path.

func (Path) String

func (p Path) String() string

String returns the string form of the raw data in the path.

func (Path) UnencryptedPath

func (p Path) UnencryptedPath() paths.Unencrypted

UnencryptedPath returns the unencrypted path part of the path.

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.

func (*PeekThresholdReader) Read added in v1.0.6

func (pt *PeekThresholdReader) Read(p []byte) (n int, err error)

Read initially reads bytes from the internal buffer, then continues reading from the wrapped data reader. The number of bytes read `n` is returned.

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 interface {
	Get(ctx context.Context, path storj.Path, object storj.Object) (ranger.Ranger, error)
	Put(ctx context.Context, path storj.Path, data io.Reader, metadata Metadata, expiration time.Time) (Meta, error)
}

Store interface methods for streams to satisfy to be a store.

func NewStreamStore

func NewStreamStore(metainfo *metainfo.Client, ec ecclient.Client, segmentSize int64, encStore *encryption.Store, encBlockSize int, cipher storj.CipherSuite, inlineThreshold int, maxEncryptedSegmentSize int64) (Store, error)

NewStreamStore constructs a Store.

Jump to

Keyboard shortcuts

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