streams

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: May 28, 2019 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecryptAfterBucket

func DecryptAfterBucket(path storj.Path, cipher storj.Cipher, key *storj.Key) (decrypted storj.Path, err error)

DecryptAfterBucket decrypts a path without modifying its first element

func DecryptStreamInfo

func DecryptStreamInfo(ctx context.Context, streamMetaBytes []byte, path storj.Path, rootKey *storj.Key) (
	streamInfo []byte, streamMeta pb.StreamMeta, err error)

DecryptStreamInfo decrypts stream info

func EncryptAfterBucket

func EncryptAfterBucket(path storj.Path, cipher storj.Cipher, key *storj.Key) (encrypted storj.Path, err error)

EncryptAfterBucket encrypts a path without encrypting its first element

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     storj.Path
	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 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 {
	Meta(ctx context.Context, path storj.Path, pathCipher storj.Cipher) (Meta, error)
	Get(ctx context.Context, path storj.Path, pathCipher storj.Cipher) (ranger.Ranger, Meta, error)
	Put(ctx context.Context, path storj.Path, pathCipher storj.Cipher, data io.Reader, metadata []byte, expiration time.Time) (Meta, error)
	Delete(ctx context.Context, path storj.Path, pathCipher storj.Cipher) error
	List(ctx context.Context, prefix, startAfter, endBefore storj.Path, pathCipher storj.Cipher, 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(segments segments.Store, segmentSize int64, rootKey *storj.Key, encBlockSize int, cipher storj.Cipher) (Store, error)

NewStreamStore stuff

Jump to

Keyboard shortcuts

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