Documentation ¶
Index ¶
- Variables
- type PeergosBlockstore
- func (bs *PeergosBlockstore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error)
- func (bs *PeergosBlockstore) DeleteBlock(c cid.Cid) error
- func (bs *PeergosBlockstore) Get(c cid.Cid) (blocks.Block, error)
- func (bs *PeergosBlockstore) GetSize(c cid.Cid) (int, error)
- func (bs *PeergosBlockstore) Has(c cid.Cid) (bool, error)
- func (bs *PeergosBlockstore) HashOnRead(enabled bool)
- func (bs *PeergosBlockstore) Put(b blocks.Block) error
- func (bs *PeergosBlockstore) PutMany(blocks []blocks.Block) error
- type TypeLimitedBlockstore
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidBlockType = errors.New("Invalid block type")
Functions ¶
This section is empty.
Types ¶
type PeergosBlockstore ¶
type PeergosBlockstore struct { TypeLimitedBlockstore // contains filtered or unexported fields }
func (*PeergosBlockstore) AllKeysChan ¶
func (*PeergosBlockstore) DeleteBlock ¶
func (bs *PeergosBlockstore) DeleteBlock(c cid.Cid) error
func (*PeergosBlockstore) HashOnRead ¶
func (bs *PeergosBlockstore) HashOnRead(enabled bool)
type TypeLimitedBlockstore ¶
type TypeLimitedBlockstore interface { DeleteBlock(cid.Cid) error Has(cid.Cid) (bool, error) Get(cid.Cid) (blocks.Block, error) // GetSize returns the CIDs mapped BlockSize GetSize(cid.Cid) (int, error) // Put puts a given block to the underlying datastore Put(blocks.Block) error // PutMany puts a slice of blocks at the same time using batching // capabilities of the underlying datastore whenever possible. PutMany([]blocks.Block) 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. AllKeysChan(ctx context.Context) (<-chan cid.Cid, error) // HashOnRead specifies if every read block should be // rehashed to make sure it matches its CID. HashOnRead(enabled bool) }
func NewPeergosBlockstore ¶
func NewPeergosBlockstore(bstore blockstore.Blockstore) TypeLimitedBlockstore
Click to show internal directories.
Click to hide internal directories.