Documentation ¶
Index ¶
- Constants
- Variables
- type Blockstore
- func (b *Blockstore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error)
- func (b *Blockstore) Close() error
- func (b *Blockstore) DeleteBlock(context.Context, cid.Cid) error
- func (b *Blockstore) Get(ctx context.Context, cid cid.Cid) (blocks.Block, error)
- func (b *Blockstore) GetSize(ctx context.Context, cid cid.Cid) (int, error)
- func (b *Blockstore) Has(ctx context.Context, cid cid.Cid) (bool, error)
- func (b *Blockstore) HashOnRead(_ bool)
- func (b *Blockstore) Put(ctx context.Context, block blocks.Block) error
- func (b *Blockstore) PutMany(ctx context.Context, 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 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 (b *Blockstore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error)
func (*Blockstore) Close ¶
func (b *Blockstore) Close() error
func (*Blockstore) DeleteBlock ¶
func (b *Blockstore) DeleteBlock(context.Context, cid.Cid) error
func (*Blockstore) GetSize ¶
func (b *Blockstore) GetSize(ctx context.Context, cid cid.Cid) (int, 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.