inmemstore

package
v2.2.0-rc8 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: BSD-3-Clause Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Batch

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

func (*Batch) Commit

func (i *Batch) Commit() error

Commit implements storage.Batch interface Commit method.

func (*Batch) Delete

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

Delete implements storage.Batch interface Delete method.

func (*Batch) Put

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

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

Batch implements storage.BatchedStore interface Batch method.

func (*Store) Close

func (s *Store) Close() error

func (*Store) Count

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

func (*Store) Delete

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

func (*Store) Get

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

func (*Store) GetSize

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

func (*Store) Has

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

func (*Store) Iterate

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

func (*Store) Put

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

Jump to

Keyboard shortcuts

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