Documentation ¶
Index ¶
- type Blockstore
- func (bs *Blockstore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error)
- func (bs *Blockstore) DeleteBlock(ctx context.Context, c cid.Cid) error
- func (bs *Blockstore) DeleteMany(ctx context.Context, cids []cid.Cid) error
- func (bs *Blockstore) Get(ctx context.Context, c cid.Cid) (blocks.Block, error)
- func (bs *Blockstore) GetSize(ctx context.Context, c cid.Cid) (int, error)
- func (bs *Blockstore) Has(ctx context.Context, c cid.Cid) (bool, error)
- func (bs *Blockstore) HashOnRead(enabled bool)
- func (bs *Blockstore) Put(ctx context.Context, blk blocks.Block) error
- func (bs *Blockstore) PutMany(ctx context.Context, blks []blocks.Block) error
- func (bs *Blockstore) View(ctx context.Context, c cid.Cid, f func([]byte) error) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Blockstore ¶
type Blockstore struct {
// contains filtered or unexported fields
}
func NewBlockstore ¶
func NewBlockstore(from, to blockstore.Blockstore, del bool) (*Blockstore, error)
func (*Blockstore) AllKeysChan ¶
func (bs *Blockstore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error)
AllKeysChan returns a channel from which the CIDs in the Blockstore can be read. It should respect the given context, closing the channel if it becomes Done.
func (*Blockstore) DeleteBlock ¶
func (bs *Blockstore) DeleteBlock(ctx context.Context, c cid.Cid) error
func (*Blockstore) DeleteMany ¶
func (bs *Blockstore) DeleteMany(ctx context.Context, cids []cid.Cid) error
func (*Blockstore) GetSize ¶
func (bs *Blockstore) GetSize(ctx context.Context, c cid.Cid) (int, error)
GetSize returns the CIDs mapped BlockSize
func (*Blockstore) HashOnRead ¶
func (bs *Blockstore) HashOnRead(enabled bool)
HashOnRead specifies if every read block should be rehashed to make sure it matches its CID.
Click to show internal directories.
Click to hide internal directories.