Documentation
¶
Index ¶
- Constants
- Variables
- type BlockCache
- func (bc *BlockCache) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error)
- func (bc *BlockCache) Close() error
- func (bc *BlockCache) DeleteBlock(cid cid.Cid) error
- func (bc *BlockCache) Get(c cid.Cid) (blocks.Block, error)
- func (bc *BlockCache) GetSize(c cid.Cid) (int, error)
- func (bc *BlockCache) Has(c cid.Cid) (bool, error)
- func (bc *BlockCache) HashOnRead(_ bool)
- func (bc *BlockCache) Put(block blocks.Block) error
- func (bc *BlockCache) PutMany(blocks []blocks.Block) error
- func (bc *BlockCache) SetUpstream(upstream blockstore.Blockstore)
- type Blockstore
- func (b *Blockstore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error)
- func (b *Blockstore) Close() error
- func (b *Blockstore) DeleteBlock(cid 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) Put(block blocks.Block) error
- func (b *Blockstore) PutMany(blocks []blocks.Block) error
- type Options
Constants ¶
View Source
const ( BlockSize = 4096 // should align with ssd block size LoadFactor = 0.5 // target occupancy of buckets )
Variables ¶
View Source
var BlocksBucket = []byte("blocks")
Functions ¶
This section is empty.
Types ¶
type BlockCache ¶
type BlockCache struct {
// contains filtered or unexported fields
}
func NewBlockCache ¶
func NewBlockCache(bs *Blockstore) *BlockCache
func (*BlockCache) AllKeysChan ¶
func (*BlockCache) Close ¶
func (bc *BlockCache) Close() error
func (*BlockCache) DeleteBlock ¶
func (bc *BlockCache) DeleteBlock(cid cid.Cid) error
func (*BlockCache) HashOnRead ¶
func (bc *BlockCache) HashOnRead(_ bool)
func (*BlockCache) Put ¶
func (bc *BlockCache) Put(block blocks.Block) error
func (*BlockCache) PutMany ¶
func (bc *BlockCache) PutMany(blocks []blocks.Block) error
func (*BlockCache) SetUpstream ¶
func (bc *BlockCache) SetUpstream(upstream blockstore.Blockstore)
type Blockstore ¶
type Blockstore struct {
// contains filtered or unexported fields
}
func Open ¶
func Open(directory string, name string, opts *gonudb.StoreOptions) (*Blockstore, error)
func (*Blockstore) AllKeysChan ¶
func (*Blockstore) Close ¶
func (b *Blockstore) Close() error
func (*Blockstore) DeleteBlock ¶
func (b *Blockstore) DeleteBlock(cid cid.Cid) error
func (*Blockstore) HashOnRead ¶
func (b *Blockstore) HashOnRead(_ bool)
type Options ¶
type Options = gonudb.StoreOptions
Click to show internal directories.
Click to hide internal directories.