Documentation ¶
Index ¶
- type Iterator
- func (it *Iterator[T, PT]) Close()
- func (it *Iterator[T, PT]) Item() *badger.Item
- func (it *Iterator[T, PT]) Key() []byte
- func (it *Iterator[T, PT]) Next()
- func (it *Iterator[T, PT]) Rewind()
- func (it *Iterator[T, PT]) Seek(key []byte)
- func (it *Iterator[T, PT]) Valid() bool
- func (it *Iterator[T, PT]) Value() (value *T, err error)
- type MetaBearer
- type PointerBinaryUnmarshaler
- type Store
- func (s *Store[T, PT]) Delete(key []byte) error
- func (s *Store[T, PT]) Get(key []byte) (value *T, err error)
- func (s *Store[T, PT]) GetWithItem(key []byte) (item *badger.Item, value *T, err error)
- func (s *Store[T, PT]) NewIterator(opts badger.IteratorOptions) badgerutils.Iterator[*T]
- func (s *Store[T, PT]) Prefix() []byte
- func (s *Store[T, PT]) Set(key []byte, value *T) error
- type TemporaryItem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Iterator ¶
type Iterator[T any, PT PointerBinaryUnmarshaler[T]] struct { // contains filtered or unexported fields }
Iterator is an iterator that unmarshal the value.
func NewIterator ¶
func NewIterator[T any, PT PointerBinaryUnmarshaler[T]](base badgerutils.BadgerIterator) *Iterator[T, PT]
NewIterator creates a new serialized iterator.
type MetaBearer ¶
type MetaBearer interface {
MetaByte() byte
}
MetaBearer is an item that has meta byte.
type PointerBinaryUnmarshaler ¶
type PointerBinaryUnmarshaler[T any] interface { encoding.BinaryUnmarshaler *T }
PointerBinaryUnmarshaler is an interface that unmarshals a binary data.
type Store ¶
type Store[T encoding.BinaryMarshaler, PT PointerBinaryUnmarshaler[T]] struct { // contains filtered or unexported fields }
Store is a store that serializes all keys and values.
func Migrate ¶
func Migrate[T, U encoding.BinaryMarshaler, PT PointerBinaryUnmarshaler[T], PU PointerBinaryUnmarshaler[U], ]( src *Store[T, PT], convert func(*T, *badger.Item) (*U, error), ) (*Store[U, PU], error)
Migrate migrates a store from one type to another.
func New ¶
func New[T encoding.BinaryMarshaler, PT PointerBinaryUnmarshaler[T]](base badgerutils.BadgerStore) *Store[T, PT]
New creates a new serialized store.
func (*Store[T, PT]) GetWithItem ¶
GetWithItem is similar to Get, but it also returns the badger.Item as well.
func (*Store[T, PT]) NewIterator ¶
func (s *Store[T, PT]) NewIterator(opts badger.IteratorOptions) badgerutils.Iterator[*T]
NewIterator creates a new iterator.
type TemporaryItem ¶
TemporaryItem is an item that has a TTL.
Click to show internal directories.
Click to hide internal directories.