mount

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dag

type Dag struct {
	Dag *uih.DagBuilderParams // use MapDataStore
	// contains filtered or unexported fields
}

Dag dag to fileStore TODO : fs 의 cid 와 dag 의 cid 가 다를 경우 동기화 처리 필요 dag 의 block 은 어느 기준으로 Garbage collect?? 블록 전체를 캐싱하고 있으면 안되는데...

func NewDag

func NewDag(ctx context.Context, blockSize int, mount *Mount, rem exchange.Interface) (*Dag, error)

func (*Dag) Download

func (d *Dag) Download(ctx context.Context, ci cid.Cid, path string) error

func (*Dag) Upload

func (d *Dag) Upload(ctx context.Context, path string, reader io.Reader) (cid.Cid, error)

type Mount

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

func NewMount

func NewMount(fs *file.FileStore, fm *file.FileManager, bs blockstore.Blockstore) *Mount

func (*Mount) AllKeysChan

func (f *Mount) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error)

AllKeysChan returns a channel from which to read the keys stored in the blockstore. If the given context is cancelled the channel will be closed.

func (*Mount) DeleteBlock

func (f *Mount) DeleteBlock(ctx context.Context, c cid.Cid) error

func (*Mount) Get

func (f *Mount) Get(ctx context.Context, c cid.Cid) (blocks.Block, error)

func (*Mount) GetSize

func (f *Mount) GetSize(ctx context.Context, c cid.Cid) (int, error)

func (*Mount) Has

func (f *Mount) Has(ctx context.Context, c cid.Cid) (bool, error)

func (*Mount) HashOnRead

func (f *Mount) HashOnRead(enabled bool)

HashOnRead calls blockstore.HashOnRead.

func (*Mount) Put

func (f *Mount) Put(ctx context.Context, b blocks.Block) error

func (*Mount) PutMany

func (f *Mount) PutMany(ctx context.Context, bs []blocks.Block) error

PutMany is like Put(), but takes a slice of blocks, allowing the underlying blockstore to perform batch transactions.

Jump to

Keyboard shortcuts

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