kvbadger

package module
v0.0.0-...-954e36a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 23, 2024 License: MIT Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BadgerStore

type BadgerStore interface {
	BadgerDB() *badger.DB
}

type Options

type Options[V any] struct {
	Codec         kv.Codec[V]
	BadgerOptions badger.Options
	DefaultTTL    time.Duration
}

func DefaultOptions

func DefaultOptions[V any](dir string) Options[V]

type StoreBinaryKey

type StoreBinaryKey[K encoding.BinaryMarshaler, V any, KP binaryPointer[K]] struct {
	// contains filtered or unexported fields
}

func NewBinaryKey

func NewBinaryKey[K encoding.BinaryMarshaler, V any, KP binaryPointer[K]](opts Options[V]) (*StoreBinaryKey[K, V, KP], error)

func (*StoreBinaryKey) BadgerDB

func (s *StoreBinaryKey) BadgerDB() *badger.DB

func (*StoreBinaryKey) Close

func (s *StoreBinaryKey) Close(ctx context.Context) error

func (*StoreBinaryKey[K, V, KP]) Delete

func (s *StoreBinaryKey[K, V, KP]) Delete(ctx context.Context, k K) error

func (*StoreBinaryKey[K, V, KP]) Edit

func (s *StoreBinaryKey[K, V, KP]) Edit(ctx context.Context, k K, edit kv.Edit[V]) error

Get implements Store.

func (*StoreBinaryKey[K, V, KP]) Get

func (s *StoreBinaryKey[K, V, KP]) Get(ctx context.Context, k K) (V, error)

func (*StoreBinaryKey[K, V, KP]) Range

func (s *StoreBinaryKey[K, V, KP]) Range(ctx context.Context, iter kv.Iter[K, V]) error

func (*StoreBinaryKey[K, V, KP]) RangeWithOptions

func (s *StoreBinaryKey[K, V, KP]) RangeWithOptions(ctx context.Context, opt badger.IteratorOptions, iter kv.Iter[K, V]) error

func (*StoreBinaryKey[K, V, KP]) RangeWithPrefix

func (s *StoreBinaryKey[K, V, KP]) RangeWithPrefix(ctx context.Context, k K, iter kv.Iter[K, V]) error

func (*StoreBinaryKey[K, V, KP]) Set

func (s *StoreBinaryKey[K, V, KP]) Set(ctx context.Context, k K, v V) error

func (*StoreBinaryKey[K, V, KP]) Transaction

func (s *StoreBinaryKey[K, V, KP]) Transaction(update bool) (kv.Store[K, V], error)

type StoreBytesKey

type StoreBytesKey[K kv.Bytes, V any] struct {
	// contains filtered or unexported fields
}

func New

func New[K kv.Bytes, V any](opts Options[V]) (*StoreBytesKey[K, V], error)

func (*StoreBytesKey) BadgerDB

func (s *StoreBytesKey) BadgerDB() *badger.DB

func (*StoreBytesKey) Close

func (s *StoreBytesKey) Close(ctx context.Context) error

func (*StoreBytesKey[K, V]) Delete

func (s *StoreBytesKey[K, V]) Delete(ctx context.Context, k K) error

func (*StoreBytesKey[K, V]) Edit

func (s *StoreBytesKey[K, V]) Edit(ctx context.Context, k K, edit kv.Edit[V]) error

Get implements Store.

func (*StoreBytesKey[K, V]) Get

func (s *StoreBytesKey[K, V]) Get(ctx context.Context, k K) (v V, err error)

func (*StoreBytesKey[K, V]) Range

func (s *StoreBytesKey[K, V]) Range(ctx context.Context, iter kv.Iter[K, V]) error

func (*StoreBytesKey[K, V]) RangeOrdered

func (s *StoreBytesKey[K, V]) RangeOrdered(ctx context.Context, order kv.Order[K], iter kv.Iter[K, V]) error

func (*StoreBytesKey[K, V]) RangeWithOptions

func (s *StoreBytesKey[K, V]) RangeWithOptions(ctx context.Context, opt badger.IteratorOptions, iter kv.Iter[K, V]) error

func (*StoreBytesKey[K, V]) RangeWithPrefix

func (s *StoreBytesKey[K, V]) RangeWithPrefix(ctx context.Context, k K, iter kv.Iter[K, V]) error

func (*StoreBytesKey[K, V]) Set

func (s *StoreBytesKey[K, V]) Set(ctx context.Context, k K, v V) error

func (*StoreBytesKey[K, V]) Transaction

func (s *StoreBytesKey[K, V]) Transaction(update bool) (kv.Store[K, V], error)

Transaction implements kv.TransactionalStore.

type StoreRaw

type StoreRaw[K, V kv.Bytes] struct {
	// contains filtered or unexported fields
}

func NewRaw

func NewRaw[K, V kv.Bytes](opts Options[V]) (*StoreRaw[K, V], error)

func (*StoreRaw) BadgerDB

func (s *StoreRaw) BadgerDB() *badger.DB

func (*StoreRaw) Close

func (s *StoreRaw) Close(ctx context.Context) error

func (*StoreRaw[K, V]) Delete

func (s *StoreRaw[K, V]) Delete(ctx context.Context, k K) error

func (*StoreRaw[K, V]) Edit

func (s *StoreRaw[K, V]) Edit(ctx context.Context, k K, edit kv.Edit[V]) error

Get implements Store.

func (*StoreRaw[K, V]) Get

func (s *StoreRaw[K, V]) Get(ctx context.Context, k K) (v V, err error)

func (*StoreRaw[K, V]) Range

func (s *StoreRaw[K, V]) Range(ctx context.Context, iter kv.Iter[K, V]) error

func (*StoreRaw[K, V]) RangeWithOptions

func (s *StoreRaw[K, V]) RangeWithOptions(ctx context.Context, opt badger.IteratorOptions, iter kv.Iter[K, V]) error

func (*StoreRaw[K, V]) RangeWithPrefix

func (s *StoreRaw[K, V]) RangeWithPrefix(ctx context.Context, k K, iter kv.Iter[K, V]) error

func (*StoreRaw[K, V]) Set

func (s *StoreRaw[K, V]) Set(ctx context.Context, k K, v V) error

func (*StoreRaw[K, V]) Transaction

func (s *StoreRaw[K, V]) Transaction(update bool) (kv.Store[K, V], error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL