Documentation ¶
Index ¶
- Variables
- type BadgerBlockStorage
- func (st *BadgerBlockStorage) Add(b *bcpb.Block) (bcpb.Digest, error)
- func (st *BadgerBlockStorage) Close() error
- func (st *BadgerBlockStorage) Exists(id bcpb.Digest) bool
- func (st *BadgerBlockStorage) Genesis() (id bcpb.Digest, blk *bcpb.Block)
- func (st *BadgerBlockStorage) Get(id bcpb.Digest) (*bcpb.Block, error)
- func (st *BadgerBlockStorage) Iter(f BlockIterator) error
- func (st *BadgerBlockStorage) Last() (id bcpb.Digest, blk *bcpb.Block)
- func (st *BadgerBlockStorage) LastExec() (id bcpb.Digest, blk *bcpb.Block)
- func (st *BadgerBlockStorage) Remove(id bcpb.Digest) error
- func (st *BadgerBlockStorage) SetGenesis(id bcpb.Digest) error
- func (st *BadgerBlockStorage) SetLast(id bcpb.Digest) error
- func (st *BadgerBlockStorage) SetLastExec(id bcpb.Digest) error
- type BadgerDataKeyIndex
- type BadgerTxStorage
- type BlockIterator
- type DataKeyIterator
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrBlockExists is used when writing a block that already exists ErrBlockExists = errors.New("block exists") // ErrBlockNotFound is used when a request block isn't found ErrBlockNotFound = errors.New("block not found") )
Functions ¶
This section is empty.
Types ¶
type BadgerBlockStorage ¶
type BadgerBlockStorage struct {
// contains filtered or unexported fields
}
func NewBadgerBlockStorage ¶
func (*BadgerBlockStorage) Close ¶
func (st *BadgerBlockStorage) Close() error
func (*BadgerBlockStorage) Genesis ¶
func (st *BadgerBlockStorage) Genesis() (id bcpb.Digest, blk *bcpb.Block)
func (*BadgerBlockStorage) Iter ¶
func (st *BadgerBlockStorage) Iter(f BlockIterator) error
func (*BadgerBlockStorage) Last ¶
func (st *BadgerBlockStorage) Last() (id bcpb.Digest, blk *bcpb.Block)
func (*BadgerBlockStorage) LastExec ¶
func (st *BadgerBlockStorage) LastExec() (id bcpb.Digest, blk *bcpb.Block)
func (*BadgerBlockStorage) SetGenesis ¶
func (st *BadgerBlockStorage) SetGenesis(id bcpb.Digest) error
func (*BadgerBlockStorage) SetLastExec ¶
func (st *BadgerBlockStorage) SetLastExec(id bcpb.Digest) error
SetLastExec checks if the given digest exists and marks it as the last executed block
type BadgerDataKeyIndex ¶
type BadgerDataKeyIndex struct {
// contains filtered or unexported fields
}
BadgerDataKeyIndex implements the DataKeyIndex interface backed by badger key-value store
func NewBadgerDataKeyIndex ¶
func NewBadgerDataKeyIndex(db *badger.DB, prefix []byte) *BadgerDataKeyIndex
NewBadgerDataKeyIndex inits a new BadgerDataKeyIndex
func (*BadgerDataKeyIndex) Get ¶
Get retrieves the digest and output index associated to the DataKey
func (*BadgerDataKeyIndex) Iter ¶
func (index *BadgerDataKeyIndex) Iter(prefix bcpb.DataKey, f DataKeyIterator) error
Iter iterates over all DataKeys starting at the given prefix DataKey
type BadgerTxStorage ¶
type BadgerTxStorage struct {
// contains filtered or unexported fields
}
BadgerTxStorage implements a badger backed TxStorage interface
func NewBadgerTxStorage ¶
func NewBadgerTxStorage(db *badger.DB, keyPrefix []byte) *BadgerTxStorage
NewBadgerTxStorage returns a new badger backed tx storage device.
func (*BadgerTxStorage) Iter ¶
func (store *BadgerTxStorage) Iter(f func(bcpb.Tx) error)
Iter iterates over each transaction, calling the f for each encountered tx.
type BlockIterator ¶
BlockIterator is used to iterate over blocks in a store
Click to show internal directories.
Click to hide internal directories.