Documentation
¶
Index ¶
- func NewMockBucket() database.Bucket
- func NewMockTx() database.Tx
- type MockBucket
- func (mb *MockBucket) Bucket(key []byte) database.Bucket
- func (mb *MockBucket) CreateBucket(key []byte) (database.Bucket, error)
- func (mb *MockBucket) CreateBucketIfNotExists(key []byte) (database.Bucket, error)
- func (mb *MockBucket) Cursor() database.Cursor
- func (mb *MockBucket) Delete(key []byte) error
- func (mb *MockBucket) DeleteBucket(key []byte) error
- func (mb *MockBucket) ForEach(func(k, v []byte) error) error
- func (mb *MockBucket) ForEachBucket(func(k []byte) error) error
- func (mb *MockBucket) Get(key []byte) []byte
- func (mb *MockBucket) Put(key, value []byte) error
- func (mb *MockBucket) Writable() bool
- type MockCursor
- func (mc *MockCursor) Bucket() database.Bucket
- func (mc *MockCursor) Delete() error
- func (mc *MockCursor) First() bool
- func (mc *MockCursor) Key() []byte
- func (mc *MockCursor) Last() bool
- func (mc *MockCursor) Next() bool
- func (mc *MockCursor) Prev() bool
- func (mc *MockCursor) Seek(seek []byte) bool
- func (mc *MockCursor) Value() []byte
- type MockTx
- func (m *MockTx) Commit() error
- func (m *MockTx) FetchBlock(key *database.BlockKey) ([]byte, error)
- func (m *MockTx) FetchBlockHeader(key *database.BlockKey) ([]byte, error)
- func (m *MockTx) FetchBlockHeaders(keys []database.BlockKey) ([][]byte, error)
- func (m *MockTx) FetchBlockRegion(region *database.BlockRegion) ([]byte, error)
- func (m *MockTx) FetchBlockRegions(regions []database.BlockRegion) ([][]byte, error)
- func (m *MockTx) FetchBlocks(keys []database.BlockKey) ([][]byte, error)
- func (m *MockTx) HasBlock(key *database.BlockKey) (bool, error)
- func (m *MockTx) HasBlocks(keys []database.BlockKey) ([]bool, error)
- func (m *MockTx) Metadata() database.Bucket
- func (m *MockTx) Rollback() error
- func (m *MockTx) StoreBlock(blockKey *database.BlockKey, blockBytes []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMockBucket ¶
Types ¶
type MockBucket ¶
type MockBucket struct {
// contains filtered or unexported fields
}
func (*MockBucket) CreateBucket ¶
func (mb *MockBucket) CreateBucket(key []byte) (database.Bucket, error)
func (*MockBucket) CreateBucketIfNotExists ¶
func (mb *MockBucket) CreateBucketIfNotExists(key []byte) (database.Bucket, error)
func (*MockBucket) Cursor ¶
func (mb *MockBucket) Cursor() database.Cursor
func (*MockBucket) Delete ¶
func (mb *MockBucket) Delete(key []byte) error
func (*MockBucket) DeleteBucket ¶
func (mb *MockBucket) DeleteBucket(key []byte) error
func (*MockBucket) ForEachBucket ¶
func (mb *MockBucket) ForEachBucket(func(k []byte) error) error
func (*MockBucket) Get ¶
func (mb *MockBucket) Get(key []byte) []byte
func (*MockBucket) Put ¶
func (mb *MockBucket) Put(key, value []byte) error
func (*MockBucket) Writable ¶
func (mb *MockBucket) Writable() bool
type MockCursor ¶
type MockCursor struct { }
func (*MockCursor) Bucket ¶
func (mc *MockCursor) Bucket() database.Bucket
func (*MockCursor) Delete ¶
func (mc *MockCursor) Delete() error
func (*MockCursor) First ¶
func (mc *MockCursor) First() bool
func (*MockCursor) Key ¶
func (mc *MockCursor) Key() []byte
func (*MockCursor) Last ¶
func (mc *MockCursor) Last() bool
func (*MockCursor) Next ¶
func (mc *MockCursor) Next() bool
func (*MockCursor) Prev ¶
func (mc *MockCursor) Prev() bool
func (*MockCursor) Seek ¶
func (mc *MockCursor) Seek(seek []byte) bool
func (*MockCursor) Value ¶
func (mc *MockCursor) Value() []byte
type MockTx ¶
type MockTx struct {
// contains filtered or unexported fields
}
func (*MockTx) FetchBlockHeader ¶
func (*MockTx) FetchBlockHeaders ¶
func (*MockTx) FetchBlockRegion ¶
func (m *MockTx) FetchBlockRegion(region *database.BlockRegion) ([]byte, error)
func (*MockTx) FetchBlockRegions ¶
func (m *MockTx) FetchBlockRegions(regions []database.BlockRegion) ([][]byte, error)
func (*MockTx) FetchBlocks ¶
Click to show internal directories.
Click to hide internal directories.