Documentation ¶
Index ¶
- Variables
- type BTreeIndex
- func (t *BTreeIndex[T]) Ascend() *BTreeIterator[T]
- func (t *BTreeIndex[T]) AscendAfter(pivot T) *BTreeIterator[T]
- func (t *BTreeIndex[T]) Descend() *BTreeIterator[T]
- func (t *BTreeIndex[T]) DescendAfter(pivot T) *BTreeIterator[T]
- func (t *BTreeIndex[T]) Get(item T) (T, bool)
- func (t *BTreeIndex[T]) Len() int
- func (t *BTreeIndex[T]) Max() (item T, ok bool)
- func (t *BTreeIndex[T]) Min() (item T, ok bool)
- type BTreeIterator
- type Collection
- func (c Collection[T]) Delete(id uint64)
- func (c Collection[T]) Get(id uint64) (t T, ok bool)
- func (c *Collection[T]) Insert(item T) (T, error)
- func (c *Collection[T]) NextID() uint64
- func (c *Collection[T]) SetSanitize(sanitize func(*T))
- func (c *Collection[T]) SetValidate(validate func(*T) error)
- func (c *Collection[T]) Update(id uint64, update func(T) (T, error)) error
- type Database
- type LogInfo
- type MapIndex
- type WALStatus
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type BTreeIndex ¶
type BTreeIndex[T any] struct { // contains filtered or unexported fields }
func NewBTreeIndex ¶
func NewBTreeIndex[T any]( c *Collection[T], less func(*T, *T) bool, include func(*T) bool, ) *BTreeIndex[T]
func (*BTreeIndex[T]) Ascend ¶
func (t *BTreeIndex[T]) Ascend() *BTreeIterator[T]
func (*BTreeIndex[T]) AscendAfter ¶
func (t *BTreeIndex[T]) AscendAfter(pivot T) *BTreeIterator[T]
func (*BTreeIndex[T]) Descend ¶
func (t *BTreeIndex[T]) Descend() *BTreeIterator[T]
func (*BTreeIndex[T]) DescendAfter ¶
func (t *BTreeIndex[T]) DescendAfter(pivot T) *BTreeIterator[T]
func (*BTreeIndex[T]) Get ¶
func (t *BTreeIndex[T]) Get(item T) (T, bool)
func (*BTreeIndex[T]) Len ¶
func (t *BTreeIndex[T]) Len() int
func (*BTreeIndex[T]) Max ¶
func (t *BTreeIndex[T]) Max() (item T, ok bool)
func (*BTreeIndex[T]) Min ¶
func (t *BTreeIndex[T]) Min() (item T, ok bool)
type BTreeIterator ¶
type BTreeIterator[T any] struct { // contains filtered or unexported fields }
func (*BTreeIterator[T]) Close ¶
func (iter *BTreeIterator[T]) Close()
func (*BTreeIterator[T]) Next ¶
func (iter *BTreeIterator[T]) Next() bool
func (*BTreeIterator[T]) Value ¶
func (iter *BTreeIterator[T]) Value() T
type Collection ¶
type Collection[T any] struct { // contains filtered or unexported fields }
func NewCollection ¶
func NewCollection[T any](db *Database, name string, getID func(*T) uint64) *Collection[T]
func (Collection[T]) Delete ¶
func (c Collection[T]) Delete(id uint64)
func (Collection[T]) Get ¶
func (c Collection[T]) Get(id uint64) (t T, ok bool)
func (*Collection[T]) Insert ¶
func (c *Collection[T]) Insert(item T) (T, error)
func (*Collection[T]) NextID ¶
func (c *Collection[T]) NextID() uint64
func (*Collection[T]) SetSanitize ¶
func (c *Collection[T]) SetSanitize(sanitize func(*T))
func (*Collection[T]) SetValidate ¶
func (c *Collection[T]) SetValidate(validate func(*T) error)
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
func NewPrimary ¶
func NewSecondary ¶
func (*Database) CleanBefore ¶ added in v1.2.0
CleanBefore deletes log entries that are more than the given number of seconds old.
type MapIndex ¶
type MapIndex[K comparable, T any] struct { // contains filtered or unexported fields }
func NewMapIndex ¶
func NewMapIndex[K comparable, T any]( c *Collection[T], name string, getKey func(*T) K, include func(*T) bool, ) *MapIndex[K, T]
Source Files ¶
Click to show internal directories.
Click to hide internal directories.