Documentation ¶
Index ¶
- type TypedStore
- func (t *TypedStore[K, V, KPtr, VPtr]) Delete(key K) (err error)
- func (t *TypedStore[K, V, KPtr, VPtr]) Get(key K) (value VPtr, err error)
- func (t *TypedStore[K, V, KPtr, VPtr]) Iterate(prefix kvstore.KeyPrefix, callback func(key K, value VPtr) (advance bool), ...) (err error)
- func (t *TypedStore[K, V, KPtr, VPtr]) Set(key K, value VPtr) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TypedStore ¶
type TypedStore[K, V any, KPtr constraints.MarshalablePtr[K], VPtr constraints.MarshalablePtr[V]] struct { // contains filtered or unexported fields }
TypedStore is a generically typed wrapper around a KVStore that abstracts serialization away.
func NewTypedStore ¶
func NewTypedStore[K, V any, KPtr constraints.MarshalablePtr[K], VPtr constraints.MarshalablePtr[V]](kv kvstore.KVStore) *TypedStore[K, V, KPtr, VPtr]
NewTypedStore is the constructor for TypedStore.
func (*TypedStore[K, V, KPtr, VPtr]) Delete ¶
func (t *TypedStore[K, V, KPtr, VPtr]) Delete(key K) (err error)
Delete deletes the given key from the store.
func (*TypedStore[K, V, KPtr, VPtr]) Get ¶
func (t *TypedStore[K, V, KPtr, VPtr]) Get(key K) (value VPtr, err error)
Get gets the given key or an error if an error occurred.
func (*TypedStore[K, V, KPtr, VPtr]) Iterate ¶
func (t *TypedStore[K, V, KPtr, VPtr]) Iterate(prefix kvstore.KeyPrefix, callback func(key K, value VPtr) (advance bool), direction ...kvstore.IterDirection) (err error)
func (*TypedStore[K, V, KPtr, VPtr]) Set ¶
func (t *TypedStore[K, V, KPtr, VPtr]) Set(key K, value VPtr) (err error)
Set sets the given key and value.
Click to show internal directories.
Click to hide internal directories.