streamingstore

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2023 License: Apache-2.0, MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StreamingStore

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

StreamingStore is a storage that opens the underlying CAR storage only when required. So it should avoid creating CAR files that aren't ultimately touched and therefore need cleanup. Two storage systems are used by StreamingStore. One that can perform both read and write operations to serve as the block service for graphsync; and the other that only performs write operations, that can be used to stream CAR contents to the client. A getWriter callback is used to get a writer to the streaming storage only when it's needed. This can be used to trigger additional work when the storage is actually being setup. Put() operations will write to both storage systems, and will block until both are written.

func NewStreamingStore

func NewStreamingStore(ctx context.Context, roots []cid.Cid, tempDir string, getWriter func() (io.Writer, error), errorCb func(error)) *StreamingStore

func (*StreamingStore) Close

func (ss *StreamingStore) Close() error

func (*StreamingStore) Get

func (ss *StreamingStore) Get(ctx context.Context, key string) ([]byte, error)

func (*StreamingStore) GetStream

func (ss *StreamingStore) GetStream(ctx context.Context, key string) (io.ReadCloser, error)

func (*StreamingStore) Has

func (ss *StreamingStore) Has(ctx context.Context, key string) (bool, error)

func (*StreamingStore) Put

func (ss *StreamingStore) Put(ctx context.Context, key string, data []byte) error

Jump to

Keyboard shortcuts

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