Documentation
¶
Index ¶
- Constants
- Variables
- type Address
- type BlockReader
- func (s BlockReader) BlockSize() uint64
- func (s BlockReader) GetChildAddress(i int) Address
- func (s BlockReader) GetData() []byte
- func (s BlockReader) GetLowestDescendentAddress() Address
- func (s BlockReader) GetUsedDataSize() uint64
- func (s BlockReader) NumberOfChildren() int
- func (s BlockReader) String() string
- func (s BlockReader) Type() BlockType
- type BlockType
- type BlockWriter
- type ReadTransaction
- type Reader
- type ReaderWriter
- type Store
- type WriteTransaction
- func (w *WriteTransaction) AppendBlock(blockType BlockType, numberOfChildren int, dataSize int) (BlockWriter, error)
- func (w *WriteTransaction) Commit(a Address) (newRoot Address, err error)
- func (w *WriteTransaction) GetBlock(a Address) (BlockReader, error)
- func (w *WriteTransaction) Rollback() error
- type Writer
Constants ¶
View Source
const MaxSegmentSize = 1024 * 1024 * 1024 * 1024
Variables ¶
View Source
var BlockTypeNameMap = map[BlockType]string{ TypeUndefined: "Undefined", TypeCommit: "Commit", TypeDataLeaf: "DataLeaf", TypeDataNode: "DataNode", TypeBTreeNode: "BTreeNode", }
View Source
var ErrBlockNotFound = errors.New("block not found")
Functions ¶
This section is empty.
Types ¶
type BlockReader ¶
type BlockReader []byte
func NewBlockReader ¶
func NewBlockReader(data []byte) (BlockReader, error)
func (BlockReader) BlockSize ¶
func (s BlockReader) BlockSize() uint64
func (BlockReader) GetChildAddress ¶
func (s BlockReader) GetChildAddress(i int) Address
func (BlockReader) GetData ¶
func (s BlockReader) GetData() []byte
func (BlockReader) GetLowestDescendentAddress ¶
func (s BlockReader) GetLowestDescendentAddress() Address
func (BlockReader) GetUsedDataSize ¶
func (s BlockReader) GetUsedDataSize() uint64
func (BlockReader) NumberOfChildren ¶
func (s BlockReader) NumberOfChildren() int
func (BlockReader) String ¶
func (s BlockReader) String() string
func (BlockReader) Type ¶
func (s BlockReader) Type() BlockType
type BlockWriter ¶
type BlockWriter struct { BlockReader Data []byte Address // contains filtered or unexported fields }
type ReadTransaction ¶
type ReadTransaction struct {
// contains filtered or unexported fields
}
func (*ReadTransaction) GetBlock ¶
func (r *ReadTransaction) GetBlock(a Address) (BlockReader, error)
type Reader ¶
type Reader interface {
GetBlock(a Address) (BlockReader, error)
}
type ReaderWriter ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) NewReadTransaction ¶
func (s *Store) NewReadTransaction() *ReadTransaction
func (*Store) NewWriteTransaction ¶
func (*Store) PrintStats ¶
func (s *Store) PrintStats()
type WriteTransaction ¶
type WriteTransaction struct {
// contains filtered or unexported fields
}
func (*WriteTransaction) AppendBlock ¶
func (w *WriteTransaction) AppendBlock(blockType BlockType, numberOfChildren int, dataSize int) (BlockWriter, error)
func (*WriteTransaction) Commit ¶
func (w *WriteTransaction) Commit(a Address) (newRoot Address, err error)
func (*WriteTransaction) GetBlock ¶
func (w *WriteTransaction) GetBlock(a Address) (BlockReader, error)
func (*WriteTransaction) Rollback ¶
func (w *WriteTransaction) Rollback() error
Click to show internal directories.
Click to hide internal directories.