inmemstore

package
v1.17.2-rc1 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: BSD-3-Clause Imports: 7 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Batch added in v1.17.0

type Batch struct {
	// contains filtered or unexported fields
}

func (*Batch) Commit added in v1.17.0

func (i *Batch) Commit() error

Commit implements storage.Batch interface Commit method.

func (*Batch) Delete added in v1.17.0

func (i *Batch) Delete(item storage.Item) error

Delete implements storage.Batch interface Delete method.

func (*Batch) Put added in v1.17.0

func (i *Batch) Put(item storage.Item) error

Put implements storage.Batch interface Put method.

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store implements an in-memory Store. We will use the hashicorp/go-radix implementation. This pkg provides a mutable radix which gives O(k) lookup and ordered iteration.

func New

func New() *Store

func (*Store) Batch added in v1.17.0

func (s *Store) Batch(ctx context.Context) (storage.Batch, error)

Batch implements storage.BatchedStore interface Batch method.

func (*Store) Close

func (s *Store) Close() error

func (*Store) Count added in v1.17.0

func (s *Store) Count(k storage.Key) (int, error)

func (*Store) Delete added in v1.17.0

func (s *Store) Delete(i storage.Item) error

func (*Store) Get

func (s *Store) Get(i storage.Item) error

func (*Store) GetSize added in v1.17.0

func (s *Store) GetSize(k storage.Key) (int, error)

func (*Store) Has

func (s *Store) Has(k storage.Key) (bool, error)

func (*Store) Iterate added in v1.17.0

func (s *Store) Iterate(q storage.Query, fn storage.IterateFn) error

func (*Store) Put

func (s *Store) Put(i storage.Item) error

type TxStore added in v1.17.0

type TxStore struct {
	*storage.TxStoreBase
	// contains filtered or unexported fields
}

TxStore is an implementation of in-memory Store where all Store operations are done in a transaction.

func NewTxStore added in v1.17.0

func NewTxStore(store storage.BatchedStore) *TxStore

NewTxStore returns a new TxStore instance backed by the given store.

func (*TxStore) Batch added in v1.17.0

func (s *TxStore) Batch(ctx context.Context) (storage.Batch, error)

Batch implements the Batcher interface.

func (*TxStore) Commit added in v1.17.0

func (s *TxStore) Commit() error

Commit implements the Tx interface.

func (*TxStore) Delete added in v1.17.0

func (s *TxStore) Delete(item storage.Item) error

Delete implements the Store interface.

func (*TxStore) NewTx added in v1.17.0

func (s *TxStore) NewTx(state *storage.TxState) storage.TxStore

NewTx implements the TxStore interface.

func (*TxStore) Put added in v1.17.0

func (s *TxStore) Put(item storage.Item) error

Put implements the Store interface.

func (*TxStore) Rollback added in v1.17.0

func (s *TxStore) Rollback() error

Rollback implements the Tx interface.

Jump to

Keyboard shortcuts

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