Documentation
¶
Index ¶
- Constants
- Variables
- func BytesToID(name [4]byte) uint32
- func IDToBytes(id uint32) [4]byte
- func KeyValuePairLength(hashSize int) int
- type ArrayListAppend
- type ArrayListAppendResult
- type ArrayListGet
- type ArrayListHeader
- type ArrayListInit
- type ArrayListSlice
- type BTreeHeader
- type BTreeInsertResult
- type BTreeJoinResult
- type BTreeNode
- type BTreeNodeKind
- type BTreeNodeRef
- type BTreeSplitResult
- type BTreeWriteSlot
- type Bytes
- type Context
- type ContextFunction
- type Core
- type CoreBufferedFile
- func (c *CoreBufferedFile) Close() error
- func (c *CoreBufferedFile) Flush() error
- func (c *CoreBufferedFile) Length() (int64, error)
- func (c *CoreBufferedFile) Position() (int64, error)
- func (c *CoreBufferedFile) Read(p []byte) error
- func (c *CoreBufferedFile) SeekTo(pos int64) error
- func (c *CoreBufferedFile) SetLength(length int64) error
- func (c *CoreBufferedFile) Sync() error
- func (c *CoreBufferedFile) Write(p []byte) error
- type CoreFile
- func (c *CoreFile) Flush() error
- func (c *CoreFile) Length() (int64, error)
- func (c *CoreFile) Position() (int64, error)
- func (c *CoreFile) Read(p []byte) error
- func (c *CoreFile) SeekTo(pos int64) error
- func (c *CoreFile) SetLength(length int64) error
- func (c *CoreFile) Sync() error
- func (c *CoreFile) Write(p []byte) error
- type CoreMemory
- func (m *CoreMemory) Flush() error
- func (m *CoreMemory) Length() (int64, error)
- func (m *CoreMemory) Position() (int64, error)
- func (m *CoreMemory) Read(p []byte) error
- func (m *CoreMemory) SeekTo(pos int64) error
- func (m *CoreMemory) SetLength(length int64) error
- func (m *CoreMemory) Sync() error
- func (m *CoreMemory) Write(p []byte) error
- type CursorIterator
- type CursorReader
- func (r *CursorReader) Read(p []byte) (int, error)
- func (r *CursorReader) ReadAll() ([]byte, error)
- func (r *CursorReader) ReadByte() (byte, error)
- func (r *CursorReader) ReadFully(buf []byte) error
- func (r *CursorReader) ReadInt32() (int32, error)
- func (r *CursorReader) ReadLong() (int64, error)
- func (r *CursorReader) ReadShort() (int16, error)
- func (r *CursorReader) SeekTo(position int64) error
- type CursorWriter
- type Database
- type Float
- type HashMapGetKVPair
- type HashMapGetKey
- type HashMapGetPart
- type HashMapGetResult
- type HashMapGetTarget
- type HashMapGetValue
- type HashMapInitPart
- type HashMapRemovePart
- type Hasher
- type Header
- type Int
- type KeyValuePair
- type LinkedArrayListAppend
- type LinkedArrayListConcatPart
- type LinkedArrayListGet
- type LinkedArrayListInit
- type LinkedArrayListInsertPart
- type LinkedArrayListRemovePart
- type LinkedArrayListSlicePart
- type PathPart
- type ReadArrayList
- func (a *ReadArrayList) All() iter.Seq2[*ReadCursor, error]
- func (a *ReadArrayList) AllFrom(index int64) iter.Seq2[*ReadCursor, error]
- func (a *ReadArrayList) Count() (int64, error)
- func (a *ReadArrayList) GetCursor(index int64) (*ReadCursor, error)
- func (a *ReadArrayList) GetSlot(index int64) (Slot, error)
- func (a *ReadArrayList) Slot() Slot
- type ReadCountedHashMap
- type ReadCountedHashSet
- type ReadCursor
- func (c *ReadCursor) All() iter.Seq2[*ReadCursor, error]
- func (c *ReadCursor) Count() (int64, error)
- func (c *ReadCursor) ReadBytes(maxSize int64) ([]byte, error)
- func (c *ReadCursor) ReadBytesObject(maxSize int64) (Bytes, error)
- func (c *ReadCursor) ReadFloat() (float64, error)
- func (c *ReadCursor) ReadInt() (int64, error)
- func (c *ReadCursor) ReadKeyValuePair() (*ReadKVPairCursor, error)
- func (c *ReadCursor) ReadPath(path []PathPart) (*ReadCursor, error)
- func (c *ReadCursor) ReadPathSlot(path []PathPart) (Slot, error)
- func (c *ReadCursor) ReadUint() (uint64, error)
- func (c *ReadCursor) Reader() (*CursorReader, error)
- func (c *ReadCursor) Slot() Slot
- type ReadHashMap
- func (m *ReadHashMap) All() iter.Seq2[*ReadCursor, error]
- func (m *ReadHashMap) GetCursor(key string) (*ReadCursor, error)
- func (m *ReadHashMap) GetCursorByBytes(key Bytes) (*ReadCursor, error)
- func (m *ReadHashMap) GetCursorByHash(hash []byte) (*ReadCursor, error)
- func (m *ReadHashMap) GetKeyCursor(key string) (*ReadCursor, error)
- func (m *ReadHashMap) GetKeyCursorByBytes(key Bytes) (*ReadCursor, error)
- func (m *ReadHashMap) GetKeyCursorByHash(hash []byte) (*ReadCursor, error)
- func (m *ReadHashMap) GetKeySlot(key string) (Slot, error)
- func (m *ReadHashMap) GetKeySlotByBytes(key Bytes) (Slot, error)
- func (m *ReadHashMap) GetKeySlotByHash(hash []byte) (Slot, error)
- func (m *ReadHashMap) GetKeyValuePair(key string) (*ReadKVPairCursor, error)
- func (m *ReadHashMap) GetKeyValuePairByBytes(key Bytes) (*ReadKVPairCursor, error)
- func (m *ReadHashMap) GetKeyValuePairByHash(hash []byte) (*ReadKVPairCursor, error)
- func (m *ReadHashMap) GetSlot(key string) (Slot, error)
- func (m *ReadHashMap) GetSlotByBytes(key Bytes) (Slot, error)
- func (m *ReadHashMap) GetSlotByHash(hash []byte) (Slot, error)
- func (m *ReadHashMap) Slot() Slot
- type ReadHashSet
- func (s *ReadHashSet) All() iter.Seq2[*ReadCursor, error]
- func (s *ReadHashSet) GetCursor(key string) (*ReadCursor, error)
- func (s *ReadHashSet) GetCursorByBytes(key Bytes) (*ReadCursor, error)
- func (s *ReadHashSet) GetCursorByHash(hash []byte) (*ReadCursor, error)
- func (s *ReadHashSet) GetSlot(key string) (Slot, error)
- func (s *ReadHashSet) GetSlotByBytes(key Bytes) (Slot, error)
- func (s *ReadHashSet) GetSlotByHash(hash []byte) (Slot, error)
- func (s *ReadHashSet) Slot() Slot
- type ReadKVPairCursor
- type ReadLinkedArrayList
- func (a *ReadLinkedArrayList) All() iter.Seq2[*ReadCursor, error]
- func (a *ReadLinkedArrayList) AllFrom(index int64) iter.Seq2[*ReadCursor, error]
- func (a *ReadLinkedArrayList) Count() (int64, error)
- func (a *ReadLinkedArrayList) GetCursor(index int64) (*ReadCursor, error)
- func (a *ReadLinkedArrayList) GetSlot(index int64) (Slot, error)
- func (a *ReadLinkedArrayList) Slot() Slot
- type ReadSortedMap
- func (m *ReadSortedMap) All() iter.Seq2[*ReadCursor, error]
- func (m *ReadSortedMap) AllFrom(startKey []byte) iter.Seq2[*ReadCursor, error]
- func (m *ReadSortedMap) AllFromIndex(startIndex int64) iter.Seq2[*ReadCursor, error]
- func (m *ReadSortedMap) Count() (int64, error)
- func (m *ReadSortedMap) GetCursor(key string) (*ReadCursor, error)
- func (m *ReadSortedMap) GetCursorByBytes(key []byte) (*ReadCursor, error)
- func (m *ReadSortedMap) GetIndexKeyValuePair(index int64) (*ReadKVPairCursor, error)
- func (m *ReadSortedMap) GetKeyValuePair(key string) (*ReadKVPairCursor, error)
- func (m *ReadSortedMap) GetKeyValuePairByBytes(key []byte) (*ReadKVPairCursor, error)
- func (m *ReadSortedMap) GetSlot(key string) (Slot, error)
- func (m *ReadSortedMap) GetSlotByBytes(key []byte) (Slot, error)
- func (m *ReadSortedMap) Rank(key string) (int64, error)
- func (m *ReadSortedMap) RankByBytes(key []byte) (int64, error)
- func (m *ReadSortedMap) Slot() Slot
- type ReadSortedSet
- func (s *ReadSortedSet) All() iter.Seq2[*ReadCursor, error]
- func (s *ReadSortedSet) AllFrom(startKey []byte) iter.Seq2[*ReadCursor, error]
- func (s *ReadSortedSet) AllFromIndex(startIndex int64) iter.Seq2[*ReadCursor, error]
- func (s *ReadSortedSet) Contains(key string) (bool, error)
- func (s *ReadSortedSet) ContainsByBytes(key []byte) (bool, error)
- func (s *ReadSortedSet) Count() (int64, error)
- func (s *ReadSortedSet) GetIndexKeyValuePair(index int64) (*ReadKVPairCursor, error)
- func (s *ReadSortedSet) Rank(key string) (int64, error)
- func (s *ReadSortedSet) RankByBytes(key []byte) (int64, error)
- func (s *ReadSortedSet) Slot() Slot
- type Slot
- type SlotPointer
- type SortedEntry
- type SortedInsertResult
- type SortedMapGetIndexPart
- type SortedMapGetKVPair
- type SortedMapGetKey
- type SortedMapGetPart
- type SortedMapGetTarget
- type SortedMapGetValue
- type SortedMapInitPart
- type SortedMapRemovePart
- type SortedNode
- type SortedRemoveResult
- type SortedSlot
- type SortedSplit
- type Tag
- type TopLevelArrayListHeader
- type Uint
- type WriteArrayList
- func (a *WriteArrayList) All() iter.Seq2[*WriteCursor, error]
- func (a *WriteArrayList) AllFrom(index int64) iter.Seq2[*WriteCursor, error]
- func (a *WriteArrayList) Append(data WriteableData) error
- func (a *WriteArrayList) AppendContext(data WriteableData, fn ContextFunction) error
- func (a *WriteArrayList) AppendCursor() (*WriteCursor, error)
- func (a *WriteArrayList) Put(index int64, data WriteableData) error
- func (a *WriteArrayList) PutCursor(index int64) (*WriteCursor, error)
- func (a *WriteArrayList) Slice(size int64) error
- type WriteCountedHashMap
- type WriteCountedHashSet
- type WriteCursor
- func (c *WriteCursor) All() iter.Seq2[*WriteCursor, error]
- func (c *WriteCursor) ReadKeyValuePair() (*WriteKVPairCursor, error)
- func (c *WriteCursor) Write(data WriteableData) error
- func (c *WriteCursor) WriteIfEmpty(data WriteableData) error
- func (c *WriteCursor) WritePath(path []PathPart) (*WriteCursor, error)
- func (c *WriteCursor) Writer() (*CursorWriter, error)
- type WriteData
- type WriteHashMap
- func (m *WriteHashMap) All() iter.Seq2[*WriteCursor, error]
- func (m *WriteHashMap) Put(key string, data WriteableData) error
- func (m *WriteHashMap) PutByHash(hash []byte, data WriteableData) error
- func (m *WriteHashMap) PutBytes(key Bytes, data WriteableData) error
- func (m *WriteHashMap) PutCursor(key string) (*WriteCursor, error)
- func (m *WriteHashMap) PutCursorByBytes(key Bytes) (*WriteCursor, error)
- func (m *WriteHashMap) PutCursorByHash(hash []byte) (*WriteCursor, error)
- func (m *WriteHashMap) PutKey(key string, data WriteableData) error
- func (m *WriteHashMap) PutKeyByBytes(key Bytes, data WriteableData) error
- func (m *WriteHashMap) PutKeyByHash(hash []byte, data WriteableData) error
- func (m *WriteHashMap) PutKeyCursor(key string) (*WriteCursor, error)
- func (m *WriteHashMap) PutKeyCursorByBytes(key Bytes) (*WriteCursor, error)
- func (m *WriteHashMap) PutKeyCursorByHash(hash []byte) (*WriteCursor, error)
- func (m *WriteHashMap) Remove(key string) (bool, error)
- func (m *WriteHashMap) RemoveByBytes(key Bytes) (bool, error)
- func (m *WriteHashMap) RemoveByHash(hash []byte) (bool, error)
- type WriteHashSet
- func (s *WriteHashSet) All() iter.Seq2[*WriteCursor, error]
- func (s *WriteHashSet) Put(key string) error
- func (s *WriteHashSet) PutByHash(hash []byte, data WriteableData) error
- func (s *WriteHashSet) PutBytes(key Bytes) error
- func (s *WriteHashSet) PutCursor(key string) (*WriteCursor, error)
- func (s *WriteHashSet) PutCursorByBytes(key Bytes) (*WriteCursor, error)
- func (s *WriteHashSet) PutCursorByHash(hash []byte) (*WriteCursor, error)
- func (s *WriteHashSet) Remove(key string) (bool, error)
- func (s *WriteHashSet) RemoveByBytes(key Bytes) (bool, error)
- func (s *WriteHashSet) RemoveByHash(hash []byte) (bool, error)
- type WriteKVPairCursor
- type WriteLinkedArrayList
- func (a *WriteLinkedArrayList) All() iter.Seq2[*WriteCursor, error]
- func (a *WriteLinkedArrayList) AllFrom(index int64) iter.Seq2[*WriteCursor, error]
- func (a *WriteLinkedArrayList) Append(data WriteableData) error
- func (a *WriteLinkedArrayList) AppendCursor() (*WriteCursor, error)
- func (a *WriteLinkedArrayList) Concat(list Slot) error
- func (a *WriteLinkedArrayList) Insert(index int64, data WriteableData) error
- func (a *WriteLinkedArrayList) InsertCursor(index int64) (*WriteCursor, error)
- func (a *WriteLinkedArrayList) Put(index int64, data WriteableData) error
- func (a *WriteLinkedArrayList) PutCursor(index int64) (*WriteCursor, error)
- func (a *WriteLinkedArrayList) Remove(index int64) error
- func (a *WriteLinkedArrayList) Slice(offset, size int64) error
- type WriteMode
- type WriteSortedMap
- func (m *WriteSortedMap) All() iter.Seq2[*WriteCursor, error]
- func (m *WriteSortedMap) AllFrom(startKey []byte) iter.Seq2[*WriteCursor, error]
- func (m *WriteSortedMap) AllFromIndex(startIndex int64) iter.Seq2[*WriteCursor, error]
- func (m *WriteSortedMap) Put(key string, data WriteableData) error
- func (m *WriteSortedMap) PutByBytes(key []byte, data WriteableData) error
- func (m *WriteSortedMap) PutCursor(key string) (*WriteCursor, error)
- func (m *WriteSortedMap) PutCursorByBytes(key []byte) (*WriteCursor, error)
- func (m *WriteSortedMap) Remove(key string) (bool, error)
- func (m *WriteSortedMap) RemoveByBytes(key []byte) (bool, error)
- type WriteSortedSet
- func (s *WriteSortedSet) All() iter.Seq2[*WriteCursor, error]
- func (s *WriteSortedSet) AllFrom(startKey []byte) iter.Seq2[*WriteCursor, error]
- func (s *WriteSortedSet) AllFromIndex(startIndex int64) iter.Seq2[*WriteCursor, error]
- func (s *WriteSortedSet) Put(key string) error
- func (s *WriteSortedSet) PutByBytes(key []byte) error
- func (s *WriteSortedSet) Remove(key string) (bool, error)
- func (s *WriteSortedSet) RemoveByBytes(key []byte) (bool, error)
- type WriteableData
Constants ¶
const ( Version uint16 = 0 DatabaseStart = HeaderLength BitCount = 4 SlotCount = 1 << BitCount Mask int64 = SlotCount - 1 IndexBlockSize = SlotLength * SlotCount MaxBranchLength = 16 // b-tree (backs LinkedArrayList): nodes hold up to BTreeSlotCount entries BTreeSlotCount = SlotCount BTreeSplitCount = (BTreeSlotCount + 1) / 2 BTreeNodeHeaderSize = 2 BTreeLeafBlockSize = BTreeNodeHeaderSize + SlotLength*BTreeSlotCount BTreeBranchBlockSize = BTreeNodeHeaderSize + (SlotLength+8)*BTreeSlotCount // sorted_map / sorted_set node block: a leaf holds BTreeSlotCount kv_pair slots; // a branch holds child slots, separator slots, then BTreeSlotCount u64 counts SortedLeafBlockSize = BTreeNodeHeaderSize + SlotLength*BTreeSlotCount SortedBranchBlockSize = BTreeNodeHeaderSize + (SlotLength*2+8)*BTreeSlotCount )
const ArrayListHeaderLength = 16
const BTreeHeaderLength = 16
const HeaderLength = 12
const SlotLength = 9
const TopLevelArrayListHeaderLength = 8 + ArrayListHeaderLength
Variables ¶
var ( MagicNumber = [3]byte{'x', 'i', 't'} BigMask = big.NewInt(Mask) )
var ( ErrInvalidDatabase = errors.New("invalid database") ErrInvalidVersion = errors.New("invalid version") ErrInvalidHashSize = errors.New("invalid hash size") ErrKeyNotFound = errors.New("key not found") ErrWriteNotAllowed = errors.New("write not allowed") ErrUnexpectedTag = errors.New("unexpected tag") ErrCursorNotWriteable = errors.New("cursor not writeable") ErrExpectedTxStart = errors.New("expected tx start") ErrKeyOffsetExceeded = errors.New("key offset exceeded") ErrPathPartMustBeAtEnd = errors.New("path part must be at end") ErrStreamTooLong = errors.New("stream too long") ErrEndOfStream = errors.New("end of stream") ErrInvalidOffset = errors.New("invalid offset") ErrInvalidTopLevelType = errors.New("invalid top level type") ErrExpectedUnsignedLong = errors.New("expected unsigned long") ErrNoAvailableSlots = errors.New("no available slots") ErrMustSetNewSlotsToFull = errors.New("must set new slots to full") ErrEmptySlot = errors.New("empty slot") ErrExpectedRootNode = errors.New("expected root node") ErrInvalidFormatTagSize = errors.New("invalid format tag size") ErrUnexpectedWriterPosition = errors.New("unexpected writer position") ErrMaxShiftExceeded = errors.New("max shift exceeded") ErrInvalidBTreeNode = errors.New("invalid btree node") ErrInvalidBTreeNodeKind = errors.New("invalid btree node kind") ErrNotImplemented = errors.New("not implemented") ErrUnreachable = errors.New("unreachable") )
Functions ¶
func KeyValuePairLength ¶
Types ¶
type ArrayListAppend ¶
type ArrayListAppend struct{}
type ArrayListAppendResult ¶
type ArrayListAppendResult struct {
Header ArrayListHeader
SlotPtr SlotPointer
}
type ArrayListGet ¶
type ArrayListGet struct {
Index int64
}
type ArrayListHeader ¶
func ArrayListHeaderFromBytes ¶
func ArrayListHeaderFromBytes(b []byte) (ArrayListHeader, error)
func (ArrayListHeader) ToBytes ¶
func (h ArrayListHeader) ToBytes() [ArrayListHeaderLength]byte
func (ArrayListHeader) WithPtr ¶
func (h ArrayListHeader) WithPtr(ptr int64) ArrayListHeader
type ArrayListInit ¶
type ArrayListInit struct{}
type ArrayListSlice ¶
type ArrayListSlice struct {
Size int64
}
type BTreeHeader ¶ added in v0.2.0
func BTreeHeaderFromBytes ¶ added in v0.2.0
func BTreeHeaderFromBytes(b []byte) (BTreeHeader, error)
func (BTreeHeader) ToBytes ¶ added in v0.2.0
func (h BTreeHeader) ToBytes() [BTreeHeaderLength]byte
type BTreeInsertResult ¶ added in v0.2.0
type BTreeInsertResult struct {
NodePtr int64
Count int64
ValuePosition int64
Split *BTreeNodeRef
}
type BTreeJoinResult ¶ added in v0.2.0
type BTreeJoinResult struct {
NodePtr int64
Count int64
Split *BTreeNodeRef
}
type BTreeNode ¶ added in v0.2.0
type BTreeNode struct {
Kind BTreeNodeKind
Num int
Values [BTreeSlotCount]Slot // leaf
Children [BTreeSlotCount]Slot // branch
Counts [BTreeSlotCount]int64 // branch
}
func (*BTreeNode) SubtreeCount ¶ added in v0.2.0
type BTreeNodeKind ¶ added in v0.2.0
type BTreeNodeKind byte
const ( BTreeKindLeaf BTreeNodeKind = 0 BTreeKindBranch BTreeNodeKind = 1 )
type BTreeNodeRef ¶ added in v0.2.0
a node pointer plus the element count of its subtree (the right sibling of a split)
type BTreeSplitResult ¶ added in v0.2.0
type BTreeWriteSlot ¶ added in v0.2.0
type Context ¶
type Context struct {
Function ContextFunction
}
type ContextFunction ¶
type ContextFunction func(cursor *WriteCursor) error
type CoreBufferedFile ¶
type CoreBufferedFile struct {
// contains filtered or unexported fields
}
func NewCoreBufferedFile ¶
func NewCoreBufferedFile(f *os.File) *CoreBufferedFile
func NewCoreBufferedFileWithSize ¶
func NewCoreBufferedFileWithSize(f *os.File, bufferSize int) *CoreBufferedFile
func (*CoreBufferedFile) Close ¶
func (c *CoreBufferedFile) Close() error
func (*CoreBufferedFile) Flush ¶
func (c *CoreBufferedFile) Flush() error
func (*CoreBufferedFile) Length ¶
func (c *CoreBufferedFile) Length() (int64, error)
func (*CoreBufferedFile) Position ¶
func (c *CoreBufferedFile) Position() (int64, error)
func (*CoreBufferedFile) Read ¶
func (c *CoreBufferedFile) Read(p []byte) error
func (*CoreBufferedFile) SeekTo ¶
func (c *CoreBufferedFile) SeekTo(pos int64) error
func (*CoreBufferedFile) SetLength ¶
func (c *CoreBufferedFile) SetLength(length int64) error
func (*CoreBufferedFile) Sync ¶
func (c *CoreBufferedFile) Sync() error
func (*CoreBufferedFile) Write ¶
func (c *CoreBufferedFile) Write(p []byte) error
type CoreFile ¶
func NewCoreFile ¶
type CoreMemory ¶
type CoreMemory struct {
// contains filtered or unexported fields
}
func NewCoreMemory ¶
func NewCoreMemory() *CoreMemory
func (*CoreMemory) Flush ¶
func (m *CoreMemory) Flush() error
func (*CoreMemory) Length ¶
func (m *CoreMemory) Length() (int64, error)
func (*CoreMemory) Position ¶
func (m *CoreMemory) Position() (int64, error)
func (*CoreMemory) Read ¶
func (m *CoreMemory) Read(p []byte) error
func (*CoreMemory) SeekTo ¶
func (m *CoreMemory) SeekTo(pos int64) error
func (*CoreMemory) SetLength ¶
func (m *CoreMemory) SetLength(length int64) error
func (*CoreMemory) Sync ¶
func (m *CoreMemory) Sync() error
func (*CoreMemory) Write ¶
func (m *CoreMemory) Write(p []byte) error
type CursorIterator ¶
type CursorIterator struct {
// contains filtered or unexported fields
}
type CursorReader ¶
type CursorReader struct {
// contains filtered or unexported fields
}
func (*CursorReader) ReadAll ¶
func (r *CursorReader) ReadAll() ([]byte, error)
func (*CursorReader) ReadByte ¶
func (r *CursorReader) ReadByte() (byte, error)
func (*CursorReader) ReadFully ¶
func (r *CursorReader) ReadFully(buf []byte) error
func (*CursorReader) ReadInt32 ¶
func (r *CursorReader) ReadInt32() (int32, error)
func (*CursorReader) ReadLong ¶
func (r *CursorReader) ReadLong() (int64, error)
func (*CursorReader) ReadShort ¶
func (r *CursorReader) ReadShort() (int16, error)
func (*CursorReader) SeekTo ¶
func (r *CursorReader) SeekTo(position int64) error
type CursorWriter ¶
type CursorWriter struct {
FormatTag []byte
// contains filtered or unexported fields
}
func (*CursorWriter) Finish ¶
func (w *CursorWriter) Finish() error
func (*CursorWriter) SeekTo ¶
func (w *CursorWriter) SeekTo(position int64)
type Database ¶
type Database struct {
Core Core
Header Header
TxStart *int64
// contains filtered or unexported fields
}
func (*Database) RootCursor ¶
func (db *Database) RootCursor() *WriteCursor
type HashMapGetKVPair ¶
type HashMapGetKVPair struct{ Hash []byte }
type HashMapGetKey ¶
type HashMapGetKey struct{ Hash []byte }
type HashMapGetPart ¶
type HashMapGetPart struct {
Target HashMapGetTarget
}
type HashMapGetResult ¶
type HashMapGetResult struct {
SlotPtr SlotPointer
IsEmpty bool
}
type HashMapGetTarget ¶
type HashMapGetTarget interface {
// contains filtered or unexported methods
}
type HashMapGetValue ¶
type HashMapGetValue struct{ Hash []byte }
type HashMapInitPart ¶
type HashMapRemovePart ¶
type HashMapRemovePart struct {
Hash []byte
}
type Header ¶
func ReadHeader ¶
func (Header) ToBytes ¶
func (h Header) ToBytes() [HeaderLength]byte
type KeyValuePair ¶
func KeyValuePairFromBytes ¶
func KeyValuePairFromBytes(b []byte, hashSize int) KeyValuePair
func (KeyValuePair) ToBytes ¶
func (kvp KeyValuePair) ToBytes() []byte
type LinkedArrayListAppend ¶
type LinkedArrayListAppend struct{}
type LinkedArrayListConcatPart ¶
type LinkedArrayListConcatPart struct {
List Slot
}
type LinkedArrayListGet ¶
type LinkedArrayListGet struct {
Index int64
}
type LinkedArrayListInit ¶
type LinkedArrayListInit struct{}
type LinkedArrayListInsertPart ¶
type LinkedArrayListInsertPart struct {
Index int64
}
type LinkedArrayListRemovePart ¶
type LinkedArrayListRemovePart struct {
Index int64
}
type ReadArrayList ¶
type ReadArrayList struct {
Cursor *ReadCursor
}
func NewReadArrayList ¶
func NewReadArrayList(cursor *ReadCursor) (*ReadArrayList, error)
func (*ReadArrayList) All ¶
func (a *ReadArrayList) All() iter.Seq2[*ReadCursor, error]
func (*ReadArrayList) AllFrom ¶ added in v0.4.0
func (a *ReadArrayList) AllFrom(index int64) iter.Seq2[*ReadCursor, error]
AllFrom iterates starting at the given index, seeking straight to it instead of walking from the front. negative indexes count from the end.
func (*ReadArrayList) Count ¶
func (a *ReadArrayList) Count() (int64, error)
func (*ReadArrayList) GetCursor ¶
func (a *ReadArrayList) GetCursor(index int64) (*ReadCursor, error)
func (*ReadArrayList) Slot ¶
func (a *ReadArrayList) Slot() Slot
type ReadCountedHashMap ¶
type ReadCountedHashMap struct {
*ReadHashMap
}
func NewReadCountedHashMap ¶
func NewReadCountedHashMap(cursor *ReadCursor) (*ReadCountedHashMap, error)
func (*ReadCountedHashMap) Count ¶
func (m *ReadCountedHashMap) Count() (int64, error)
type ReadCountedHashSet ¶
type ReadCountedHashSet struct {
*ReadHashSet
}
func NewReadCountedHashSet ¶
func NewReadCountedHashSet(cursor *ReadCursor) (*ReadCountedHashSet, error)
func (*ReadCountedHashSet) Count ¶
func (s *ReadCountedHashSet) Count() (int64, error)
type ReadCursor ¶
type ReadCursor struct {
SlotPtr SlotPointer
DB *Database
}
func (*ReadCursor) All ¶
func (c *ReadCursor) All() iter.Seq2[*ReadCursor, error]
func (*ReadCursor) Count ¶
func (c *ReadCursor) Count() (int64, error)
func (*ReadCursor) ReadBytesObject ¶
func (c *ReadCursor) ReadBytesObject(maxSize int64) (Bytes, error)
func (*ReadCursor) ReadFloat ¶
func (c *ReadCursor) ReadFloat() (float64, error)
func (*ReadCursor) ReadInt ¶
func (c *ReadCursor) ReadInt() (int64, error)
func (*ReadCursor) ReadKeyValuePair ¶
func (c *ReadCursor) ReadKeyValuePair() (*ReadKVPairCursor, error)
func (*ReadCursor) ReadPath ¶
func (c *ReadCursor) ReadPath(path []PathPart) (*ReadCursor, error)
func (*ReadCursor) ReadPathSlot ¶
func (c *ReadCursor) ReadPathSlot(path []PathPart) (Slot, error)
func (*ReadCursor) ReadUint ¶
func (c *ReadCursor) ReadUint() (uint64, error)
func (*ReadCursor) Reader ¶
func (c *ReadCursor) Reader() (*CursorReader, error)
func (*ReadCursor) Slot ¶
func (c *ReadCursor) Slot() Slot
type ReadHashMap ¶
type ReadHashMap struct {
Cursor *ReadCursor
}
func NewReadHashMap ¶
func NewReadHashMap(cursor *ReadCursor) (*ReadHashMap, error)
func (*ReadHashMap) All ¶
func (m *ReadHashMap) All() iter.Seq2[*ReadCursor, error]
func (*ReadHashMap) GetCursor ¶
func (m *ReadHashMap) GetCursor(key string) (*ReadCursor, error)
func (*ReadHashMap) GetCursorByBytes ¶
func (m *ReadHashMap) GetCursorByBytes(key Bytes) (*ReadCursor, error)
func (*ReadHashMap) GetCursorByHash ¶
func (m *ReadHashMap) GetCursorByHash(hash []byte) (*ReadCursor, error)
func (*ReadHashMap) GetKeyCursor ¶
func (m *ReadHashMap) GetKeyCursor(key string) (*ReadCursor, error)
func (*ReadHashMap) GetKeyCursorByBytes ¶
func (m *ReadHashMap) GetKeyCursorByBytes(key Bytes) (*ReadCursor, error)
func (*ReadHashMap) GetKeyCursorByHash ¶
func (m *ReadHashMap) GetKeyCursorByHash(hash []byte) (*ReadCursor, error)
func (*ReadHashMap) GetKeySlot ¶
func (m *ReadHashMap) GetKeySlot(key string) (Slot, error)
func (*ReadHashMap) GetKeySlotByBytes ¶
func (m *ReadHashMap) GetKeySlotByBytes(key Bytes) (Slot, error)
func (*ReadHashMap) GetKeySlotByHash ¶
func (m *ReadHashMap) GetKeySlotByHash(hash []byte) (Slot, error)
func (*ReadHashMap) GetKeyValuePair ¶
func (m *ReadHashMap) GetKeyValuePair(key string) (*ReadKVPairCursor, error)
func (*ReadHashMap) GetKeyValuePairByBytes ¶
func (m *ReadHashMap) GetKeyValuePairByBytes(key Bytes) (*ReadKVPairCursor, error)
func (*ReadHashMap) GetKeyValuePairByHash ¶
func (m *ReadHashMap) GetKeyValuePairByHash(hash []byte) (*ReadKVPairCursor, error)
func (*ReadHashMap) GetSlotByBytes ¶
func (m *ReadHashMap) GetSlotByBytes(key Bytes) (Slot, error)
func (*ReadHashMap) GetSlotByHash ¶
func (m *ReadHashMap) GetSlotByHash(hash []byte) (Slot, error)
func (*ReadHashMap) Slot ¶
func (m *ReadHashMap) Slot() Slot
type ReadHashSet ¶
type ReadHashSet struct {
Cursor *ReadCursor
}
func NewReadHashSet ¶
func NewReadHashSet(cursor *ReadCursor) (*ReadHashSet, error)
func (*ReadHashSet) All ¶
func (s *ReadHashSet) All() iter.Seq2[*ReadCursor, error]
func (*ReadHashSet) GetCursor ¶
func (s *ReadHashSet) GetCursor(key string) (*ReadCursor, error)
func (*ReadHashSet) GetCursorByBytes ¶
func (s *ReadHashSet) GetCursorByBytes(key Bytes) (*ReadCursor, error)
func (*ReadHashSet) GetCursorByHash ¶
func (s *ReadHashSet) GetCursorByHash(hash []byte) (*ReadCursor, error)
func (*ReadHashSet) GetSlotByBytes ¶
func (s *ReadHashSet) GetSlotByBytes(key Bytes) (Slot, error)
func (*ReadHashSet) GetSlotByHash ¶
func (s *ReadHashSet) GetSlotByHash(hash []byte) (Slot, error)
func (*ReadHashSet) Slot ¶
func (s *ReadHashSet) Slot() Slot
type ReadKVPairCursor ¶
type ReadKVPairCursor struct {
ValueCursor *ReadCursor
KeyCursor *ReadCursor
Hash []byte
}
type ReadLinkedArrayList ¶
type ReadLinkedArrayList struct {
Cursor *ReadCursor
}
func NewReadLinkedArrayList ¶
func NewReadLinkedArrayList(cursor *ReadCursor) (*ReadLinkedArrayList, error)
func (*ReadLinkedArrayList) All ¶
func (a *ReadLinkedArrayList) All() iter.Seq2[*ReadCursor, error]
func (*ReadLinkedArrayList) AllFrom ¶ added in v0.4.0
func (a *ReadLinkedArrayList) AllFrom(index int64) iter.Seq2[*ReadCursor, error]
AllFrom iterates starting at the given index, seeking straight to it instead of walking from the front. negative indexes count from the end.
func (*ReadLinkedArrayList) Count ¶
func (a *ReadLinkedArrayList) Count() (int64, error)
func (*ReadLinkedArrayList) GetCursor ¶
func (a *ReadLinkedArrayList) GetCursor(index int64) (*ReadCursor, error)
func (*ReadLinkedArrayList) GetSlot ¶
func (a *ReadLinkedArrayList) GetSlot(index int64) (Slot, error)
func (*ReadLinkedArrayList) Slot ¶
func (a *ReadLinkedArrayList) Slot() Slot
type ReadSortedMap ¶ added in v0.2.0
type ReadSortedMap struct {
Cursor *ReadCursor
}
func NewReadSortedMap ¶ added in v0.2.0
func NewReadSortedMap(cursor *ReadCursor) (*ReadSortedMap, error)
func (*ReadSortedMap) All ¶ added in v0.2.0
func (m *ReadSortedMap) All() iter.Seq2[*ReadCursor, error]
func (*ReadSortedMap) AllFrom ¶ added in v0.4.0
func (m *ReadSortedMap) AllFrom(startKey []byte) iter.Seq2[*ReadCursor, error]
AllFrom iterates in key order starting at the first entry with key >= startKey
func (*ReadSortedMap) AllFromIndex ¶ added in v0.4.0
func (m *ReadSortedMap) AllFromIndex(startIndex int64) iter.Seq2[*ReadCursor, error]
AllFromIndex iterates in key order starting at the entry with rank startIndex
func (*ReadSortedMap) Count ¶ added in v0.2.0
func (m *ReadSortedMap) Count() (int64, error)
func (*ReadSortedMap) GetCursor ¶ added in v0.2.0
func (m *ReadSortedMap) GetCursor(key string) (*ReadCursor, error)
func (*ReadSortedMap) GetCursorByBytes ¶ added in v0.2.0
func (m *ReadSortedMap) GetCursorByBytes(key []byte) (*ReadCursor, error)
func (*ReadSortedMap) GetIndexKeyValuePair ¶ added in v0.2.0
func (m *ReadSortedMap) GetIndexKeyValuePair(index int64) (*ReadKVPairCursor, error)
GetIndexKeyValuePair returns the key/value pair at the given rank (negative counts from the end)
func (*ReadSortedMap) GetKeyValuePair ¶ added in v0.2.0
func (m *ReadSortedMap) GetKeyValuePair(key string) (*ReadKVPairCursor, error)
func (*ReadSortedMap) GetKeyValuePairByBytes ¶ added in v0.2.0
func (m *ReadSortedMap) GetKeyValuePairByBytes(key []byte) (*ReadKVPairCursor, error)
func (*ReadSortedMap) GetSlot ¶ added in v0.2.0
func (m *ReadSortedMap) GetSlot(key string) (Slot, error)
func (*ReadSortedMap) GetSlotByBytes ¶ added in v0.2.0
func (m *ReadSortedMap) GetSlotByBytes(key []byte) (Slot, error)
func (*ReadSortedMap) Rank ¶ added in v0.2.0
func (m *ReadSortedMap) Rank(key string) (int64, error)
func (*ReadSortedMap) RankByBytes ¶ added in v0.2.0
func (m *ReadSortedMap) RankByBytes(key []byte) (int64, error)
RankByBytes returns the number of keys strictly less than key
func (*ReadSortedMap) Slot ¶ added in v0.2.0
func (m *ReadSortedMap) Slot() Slot
type ReadSortedSet ¶ added in v0.2.0
type ReadSortedSet struct {
Cursor *ReadCursor
}
func NewReadSortedSet ¶ added in v0.2.0
func NewReadSortedSet(cursor *ReadCursor) (*ReadSortedSet, error)
func (*ReadSortedSet) All ¶ added in v0.2.0
func (s *ReadSortedSet) All() iter.Seq2[*ReadCursor, error]
func (*ReadSortedSet) AllFrom ¶ added in v0.4.0
func (s *ReadSortedSet) AllFrom(startKey []byte) iter.Seq2[*ReadCursor, error]
func (*ReadSortedSet) AllFromIndex ¶ added in v0.4.0
func (s *ReadSortedSet) AllFromIndex(startIndex int64) iter.Seq2[*ReadCursor, error]
func (*ReadSortedSet) Contains ¶ added in v0.2.0
func (s *ReadSortedSet) Contains(key string) (bool, error)
func (*ReadSortedSet) ContainsByBytes ¶ added in v0.2.0
func (s *ReadSortedSet) ContainsByBytes(key []byte) (bool, error)
func (*ReadSortedSet) Count ¶ added in v0.2.0
func (s *ReadSortedSet) Count() (int64, error)
func (*ReadSortedSet) GetIndexKeyValuePair ¶ added in v0.2.0
func (s *ReadSortedSet) GetIndexKeyValuePair(index int64) (*ReadKVPairCursor, error)
GetIndexKeyValuePair returns the key/value pair at the given rank (negative counts from the end)
func (*ReadSortedSet) Rank ¶ added in v0.2.0
func (s *ReadSortedSet) Rank(key string) (int64, error)
func (*ReadSortedSet) RankByBytes ¶ added in v0.2.0
func (s *ReadSortedSet) RankByBytes(key []byte) (int64, error)
RankByBytes returns the number of keys strictly less than key
func (*ReadSortedSet) Slot ¶ added in v0.2.0
func (s *ReadSortedSet) Slot() Slot
type Slot ¶
func SlotFromBytes ¶
func SlotFromBytes(b [SlotLength]byte) Slot
func (Slot) ToBytes ¶
func (s Slot) ToBytes() [SlotLength]byte
type SlotPointer ¶
func (SlotPointer) WithSlot ¶
func (sp SlotPointer) WithSlot(slot Slot) SlotPointer
type SortedEntry ¶ added in v0.2.0
type SortedInsertResult ¶ added in v0.2.0
type SortedInsertResult struct {
NodePtr int64
Count int64
ValuePosition int64
Added bool
Split *SortedSplit
}
type SortedMapGetIndexPart ¶ added in v0.2.0
type SortedMapGetIndexPart struct {
Index int64
}
type SortedMapGetKVPair ¶ added in v0.2.0
type SortedMapGetKVPair struct{ Key []byte }
type SortedMapGetKey ¶ added in v0.2.0
type SortedMapGetKey struct{ Key []byte }
type SortedMapGetPart ¶ added in v0.2.0
type SortedMapGetPart struct {
Target SortedMapGetTarget
}
type SortedMapGetTarget ¶ added in v0.2.0
type SortedMapGetTarget interface {
// contains filtered or unexported methods
}
type SortedMapGetValue ¶ added in v0.2.0
type SortedMapGetValue struct{ Key []byte }
type SortedMapInitPart ¶ added in v0.2.0
type SortedMapInitPart struct {
Set bool
}
type SortedMapRemovePart ¶ added in v0.2.0
type SortedMapRemovePart struct {
Key []byte
}
type SortedNode ¶ added in v0.2.0
type SortedNode struct {
Kind BTreeNodeKind
Num int
Entries [BTreeSlotCount]Slot // leaf
Children [BTreeSlotCount]Slot // branch
Separators [BTreeSlotCount]Slot // branch
Counts [BTreeSlotCount]int64 // branch
}
func (*SortedNode) SubtreeCount ¶ added in v0.2.0
func (n *SortedNode) SubtreeCount() int64
type SortedRemoveResult ¶ added in v0.2.0
type SortedSlot ¶ added in v0.2.0
type SortedSplit ¶ added in v0.2.0
the new right sibling produced when a node splits
type TopLevelArrayListHeader ¶
type TopLevelArrayListHeader struct {
FileSize int64
Parent ArrayListHeader
}
func (TopLevelArrayListHeader) ToBytes ¶
func (h TopLevelArrayListHeader) ToBytes() [TopLevelArrayListHeaderLength]byte
type WriteArrayList ¶
type WriteArrayList struct {
*ReadArrayList
// contains filtered or unexported fields
}
func NewWriteArrayList ¶
func NewWriteArrayList(cursor *WriteCursor) (*WriteArrayList, error)
func (*WriteArrayList) All ¶
func (a *WriteArrayList) All() iter.Seq2[*WriteCursor, error]
func (*WriteArrayList) AllFrom ¶ added in v0.5.0
func (a *WriteArrayList) AllFrom(index int64) iter.Seq2[*WriteCursor, error]
func (*WriteArrayList) Append ¶
func (a *WriteArrayList) Append(data WriteableData) error
func (*WriteArrayList) AppendContext ¶
func (a *WriteArrayList) AppendContext(data WriteableData, fn ContextFunction) error
func (*WriteArrayList) AppendCursor ¶
func (a *WriteArrayList) AppendCursor() (*WriteCursor, error)
func (*WriteArrayList) Put ¶
func (a *WriteArrayList) Put(index int64, data WriteableData) error
func (*WriteArrayList) PutCursor ¶
func (a *WriteArrayList) PutCursor(index int64) (*WriteCursor, error)
func (*WriteArrayList) Slice ¶
func (a *WriteArrayList) Slice(size int64) error
type WriteCountedHashMap ¶
type WriteCountedHashMap struct {
*WriteHashMap
}
func NewWriteCountedHashMap ¶
func NewWriteCountedHashMap(cursor *WriteCursor) (*WriteCountedHashMap, error)
func (*WriteCountedHashMap) Count ¶
func (m *WriteCountedHashMap) Count() (int64, error)
type WriteCountedHashSet ¶
type WriteCountedHashSet struct {
*WriteHashSet
}
func NewWriteCountedHashSet ¶
func NewWriteCountedHashSet(cursor *WriteCursor) (*WriteCountedHashSet, error)
func (*WriteCountedHashSet) Count ¶
func (s *WriteCountedHashSet) Count() (int64, error)
type WriteCursor ¶
type WriteCursor struct {
*ReadCursor
}
func (*WriteCursor) All ¶
func (c *WriteCursor) All() iter.Seq2[*WriteCursor, error]
func (*WriteCursor) ReadKeyValuePair ¶
func (c *WriteCursor) ReadKeyValuePair() (*WriteKVPairCursor, error)
func (*WriteCursor) Write ¶
func (c *WriteCursor) Write(data WriteableData) error
func (*WriteCursor) WriteIfEmpty ¶
func (c *WriteCursor) WriteIfEmpty(data WriteableData) error
func (*WriteCursor) WritePath ¶
func (c *WriteCursor) WritePath(path []PathPart) (*WriteCursor, error)
func (*WriteCursor) Writer ¶
func (c *WriteCursor) Writer() (*CursorWriter, error)
type WriteData ¶
type WriteData struct {
Data WriteableData
}
type WriteHashMap ¶
type WriteHashMap struct {
*ReadHashMap
// contains filtered or unexported fields
}
func NewWriteHashMap ¶
func NewWriteHashMap(cursor *WriteCursor) (*WriteHashMap, error)
func (*WriteHashMap) All ¶
func (m *WriteHashMap) All() iter.Seq2[*WriteCursor, error]
func (*WriteHashMap) Put ¶
func (m *WriteHashMap) Put(key string, data WriteableData) error
func (*WriteHashMap) PutByHash ¶
func (m *WriteHashMap) PutByHash(hash []byte, data WriteableData) error
func (*WriteHashMap) PutBytes ¶
func (m *WriteHashMap) PutBytes(key Bytes, data WriteableData) error
func (*WriteHashMap) PutCursor ¶
func (m *WriteHashMap) PutCursor(key string) (*WriteCursor, error)
func (*WriteHashMap) PutCursorByBytes ¶
func (m *WriteHashMap) PutCursorByBytes(key Bytes) (*WriteCursor, error)
func (*WriteHashMap) PutCursorByHash ¶
func (m *WriteHashMap) PutCursorByHash(hash []byte) (*WriteCursor, error)
func (*WriteHashMap) PutKey ¶
func (m *WriteHashMap) PutKey(key string, data WriteableData) error
func (*WriteHashMap) PutKeyByBytes ¶
func (m *WriteHashMap) PutKeyByBytes(key Bytes, data WriteableData) error
func (*WriteHashMap) PutKeyByHash ¶
func (m *WriteHashMap) PutKeyByHash(hash []byte, data WriteableData) error
func (*WriteHashMap) PutKeyCursor ¶
func (m *WriteHashMap) PutKeyCursor(key string) (*WriteCursor, error)
func (*WriteHashMap) PutKeyCursorByBytes ¶
func (m *WriteHashMap) PutKeyCursorByBytes(key Bytes) (*WriteCursor, error)
func (*WriteHashMap) PutKeyCursorByHash ¶
func (m *WriteHashMap) PutKeyCursorByHash(hash []byte) (*WriteCursor, error)
func (*WriteHashMap) RemoveByBytes ¶
func (m *WriteHashMap) RemoveByBytes(key Bytes) (bool, error)
func (*WriteHashMap) RemoveByHash ¶
func (m *WriteHashMap) RemoveByHash(hash []byte) (bool, error)
type WriteHashSet ¶
type WriteHashSet struct {
*ReadHashSet
// contains filtered or unexported fields
}
func NewWriteHashSet ¶
func NewWriteHashSet(cursor *WriteCursor) (*WriteHashSet, error)
func (*WriteHashSet) All ¶
func (s *WriteHashSet) All() iter.Seq2[*WriteCursor, error]
func (*WriteHashSet) Put ¶
func (s *WriteHashSet) Put(key string) error
func (*WriteHashSet) PutByHash ¶
func (s *WriteHashSet) PutByHash(hash []byte, data WriteableData) error
func (*WriteHashSet) PutBytes ¶
func (s *WriteHashSet) PutBytes(key Bytes) error
func (*WriteHashSet) PutCursor ¶
func (s *WriteHashSet) PutCursor(key string) (*WriteCursor, error)
func (*WriteHashSet) PutCursorByBytes ¶
func (s *WriteHashSet) PutCursorByBytes(key Bytes) (*WriteCursor, error)
func (*WriteHashSet) PutCursorByHash ¶
func (s *WriteHashSet) PutCursorByHash(hash []byte) (*WriteCursor, error)
func (*WriteHashSet) RemoveByBytes ¶
func (s *WriteHashSet) RemoveByBytes(key Bytes) (bool, error)
func (*WriteHashSet) RemoveByHash ¶
func (s *WriteHashSet) RemoveByHash(hash []byte) (bool, error)
type WriteKVPairCursor ¶
type WriteKVPairCursor struct {
ValueCursor *WriteCursor
KeyCursor *WriteCursor
Hash []byte
}
type WriteLinkedArrayList ¶
type WriteLinkedArrayList struct {
*ReadLinkedArrayList
// contains filtered or unexported fields
}
func NewWriteLinkedArrayList ¶
func NewWriteLinkedArrayList(cursor *WriteCursor) (*WriteLinkedArrayList, error)
func (*WriteLinkedArrayList) All ¶
func (a *WriteLinkedArrayList) All() iter.Seq2[*WriteCursor, error]
func (*WriteLinkedArrayList) AllFrom ¶ added in v0.5.0
func (a *WriteLinkedArrayList) AllFrom(index int64) iter.Seq2[*WriteCursor, error]
func (*WriteLinkedArrayList) Append ¶
func (a *WriteLinkedArrayList) Append(data WriteableData) error
func (*WriteLinkedArrayList) AppendCursor ¶
func (a *WriteLinkedArrayList) AppendCursor() (*WriteCursor, error)
func (*WriteLinkedArrayList) Concat ¶
func (a *WriteLinkedArrayList) Concat(list Slot) error
func (*WriteLinkedArrayList) Insert ¶
func (a *WriteLinkedArrayList) Insert(index int64, data WriteableData) error
func (*WriteLinkedArrayList) InsertCursor ¶
func (a *WriteLinkedArrayList) InsertCursor(index int64) (*WriteCursor, error)
func (*WriteLinkedArrayList) Put ¶
func (a *WriteLinkedArrayList) Put(index int64, data WriteableData) error
func (*WriteLinkedArrayList) PutCursor ¶
func (a *WriteLinkedArrayList) PutCursor(index int64) (*WriteCursor, error)
func (*WriteLinkedArrayList) Remove ¶
func (a *WriteLinkedArrayList) Remove(index int64) error
func (*WriteLinkedArrayList) Slice ¶
func (a *WriteLinkedArrayList) Slice(offset, size int64) error
type WriteSortedMap ¶ added in v0.2.0
type WriteSortedMap struct {
*ReadSortedMap
// contains filtered or unexported fields
}
func NewWriteSortedMap ¶ added in v0.2.0
func NewWriteSortedMap(cursor *WriteCursor) (*WriteSortedMap, error)
func (*WriteSortedMap) All ¶ added in v0.2.0
func (m *WriteSortedMap) All() iter.Seq2[*WriteCursor, error]
func (*WriteSortedMap) AllFrom ¶ added in v0.5.0
func (m *WriteSortedMap) AllFrom(startKey []byte) iter.Seq2[*WriteCursor, error]
func (*WriteSortedMap) AllFromIndex ¶ added in v0.5.0
func (m *WriteSortedMap) AllFromIndex(startIndex int64) iter.Seq2[*WriteCursor, error]
func (*WriteSortedMap) Put ¶ added in v0.2.0
func (m *WriteSortedMap) Put(key string, data WriteableData) error
func (*WriteSortedMap) PutByBytes ¶ added in v0.2.0
func (m *WriteSortedMap) PutByBytes(key []byte, data WriteableData) error
func (*WriteSortedMap) PutCursor ¶ added in v0.2.0
func (m *WriteSortedMap) PutCursor(key string) (*WriteCursor, error)
func (*WriteSortedMap) PutCursorByBytes ¶ added in v0.2.0
func (m *WriteSortedMap) PutCursorByBytes(key []byte) (*WriteCursor, error)
func (*WriteSortedMap) Remove ¶ added in v0.2.0
func (m *WriteSortedMap) Remove(key string) (bool, error)
func (*WriteSortedMap) RemoveByBytes ¶ added in v0.2.0
func (m *WriteSortedMap) RemoveByBytes(key []byte) (bool, error)
type WriteSortedSet ¶ added in v0.2.0
type WriteSortedSet struct {
*ReadSortedSet
// contains filtered or unexported fields
}
func NewWriteSortedSet ¶ added in v0.2.0
func NewWriteSortedSet(cursor *WriteCursor) (*WriteSortedSet, error)
func (*WriteSortedSet) All ¶ added in v0.2.0
func (s *WriteSortedSet) All() iter.Seq2[*WriteCursor, error]
func (*WriteSortedSet) AllFrom ¶ added in v0.5.0
func (s *WriteSortedSet) AllFrom(startKey []byte) iter.Seq2[*WriteCursor, error]
func (*WriteSortedSet) AllFromIndex ¶ added in v0.5.0
func (s *WriteSortedSet) AllFromIndex(startIndex int64) iter.Seq2[*WriteCursor, error]
func (*WriteSortedSet) Put ¶ added in v0.2.0
func (s *WriteSortedSet) Put(key string) error
func (*WriteSortedSet) PutByBytes ¶ added in v0.2.0
func (s *WriteSortedSet) PutByBytes(key []byte) error
func (*WriteSortedSet) Remove ¶ added in v0.2.0
func (s *WriteSortedSet) Remove(key string) (bool, error)
func (*WriteSortedSet) RemoveByBytes ¶ added in v0.2.0
func (s *WriteSortedSet) RemoveByBytes(key []byte) (bool, error)
type WriteableData ¶
type WriteableData interface {
// contains filtered or unexported methods
}