Versions in this module Expand all Collapse all v1 v1.0.0 Aug 15, 2021 Changes in this version + const FileIO + const LoadToRAM + const MemoryMap + var ErrBlockstoreClosed = fmt.Errorf("badger blockstore closed") + var KeyPool *pool.BufferPool = pool.GlobalPool + type Blockstore struct + DB *badger.DB + func Open(opts Options) (*Blockstore, error) + func (b *Blockstore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error) + func (b *Blockstore) Close() error + func (b *Blockstore) CollectGarbage() error + func (b *Blockstore) DeleteBlock(cid cid.Cid) error + func (b *Blockstore) DeleteMany(cids []cid.Cid) error + func (b *Blockstore) Get(cid cid.Cid) (blocks.Block, error) + func (b *Blockstore) GetSize(cid cid.Cid) (int, error) + func (b *Blockstore) Has(cid cid.Cid) (bool, error) + func (b *Blockstore) HashOnRead(_ bool) + func (b *Blockstore) PooledStorageKey(cid cid.Cid) (key []byte, pooled bool) + func (b *Blockstore) Put(block blocks.Block) error + func (b *Blockstore) PutMany(blocks []blocks.Block) error + func (b *Blockstore) StorageKey(dst []byte, cid cid.Cid) []byte + func (b *Blockstore) View(cid cid.Cid, fn func([]byte) error) error + type Options struct + Prefix string + func DefaultOptions(path string) Options + type Suite struct + NewBlockstore func(tb testing.TB) (bs blockstore.BasicBlockstore, path string) + OpenBlockstore func(tb testing.TB, path string) (bs blockstore.BasicBlockstore, err error) + func (s *Suite) RunTests(t *testing.T, prefix string) + func (s *Suite) TestAllKeysRespectsContext(t *testing.T) + func (s *Suite) TestAllKeysSimple(t *testing.T) + func (s *Suite) TestCidv0v1(t *testing.T) + func (s *Suite) TestDelete(t *testing.T) + func (s *Suite) TestDoubleClose(t *testing.T) + func (s *Suite) TestGetWhenKeyIsNil(t *testing.T) + func (s *Suite) TestGetWhenKeyNotPresent(t *testing.T) + func (s *Suite) TestHas(t *testing.T) + func (s *Suite) TestPutMany(t *testing.T) + func (s *Suite) TestPutThenGetBlock(t *testing.T) + func (s *Suite) TestPutThenGetSizeBlock(t *testing.T) + func (s *Suite) TestReopenPutGet(t *testing.T)