streams

package
v0.28.1 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2019 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TypedDecryptStreamInfo

func TypedDecryptStreamInfo(ctx context.Context, streamMetaBytes []byte, path Path, encStore *encryption.Store) (
	streamInfo []byte, streamMeta pb.StreamMeta, err error)

TypedDecryptStreamInfo decrypts stream info

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 Path

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

Path is a representation of an object path within a bucket

func CreatePath

func CreatePath(bucket string, unencPath paths.Unencrypted) (path Path)

CreatePath will create a Path for the provided information.

func ParsePath

func ParsePath(raw storj.Path) (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 SizeReader

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

SizeReader holds reader and size read so far

func NewSizeReader

func NewSizeReader(r io.Reader) *SizeReader

NewSizeReader keeps track of how much bytes are read from the reader

func (*SizeReader) Read

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

func (*SizeReader) Size

func (r *SizeReader) Size() int64

Size returns the number of bytes read so far

type Store

type Store interface {
	Get(ctx context.Context, path storj.Path, object storj.Object, pathCipher storj.CipherSuite) (ranger.Ranger, error)
	Put(ctx context.Context, path storj.Path, pathCipher storj.CipherSuite, data io.Reader, metadata []byte, expiration time.Time) (Meta, error)
	Delete(ctx context.Context, path storj.Path, pathCipher storj.CipherSuite) error
	List(ctx context.Context, prefix, startAfter storj.Path, pathCipher storj.CipherSuite, recursive bool, limit int, metaFlags uint32) (items []ListItem, more bool, err error)
}

Store interface methods for streams to satisfy to be a store

func NewStreamStore

func NewStreamStore(metainfo *metainfo.Client, segments segments.Store, 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