coretesting

package module
v0.0.0-...-899099f Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: Apache-2.0 Imports: 10 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Context

func Context() context.Context

func KVStoreService

func KVStoreService(ctx context.Context, moduleName string) store.KVStoreService

func NewMemDB

func NewMemDB() store.KVStoreWithBatch

NewMemDB creates a new MemDB.

func NewNopLogger

func NewNopLogger() log.Logger

NewNopLogger returns a new logger that does nothing.

Types

type MemDB

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

MemDB is a simple in-memory key-value store with Batch support.

func (*MemDB) Close

func (db *MemDB) Close() error

Close closes the MemDB, releasing any resources held.

func (*MemDB) Delete

func (bt *MemDB) Delete(key []byte) error

func (*MemDB) DeleteSync

func (bt *MemDB) DeleteSync(key []byte) error

func (*MemDB) Get

func (bt *MemDB) Get(key []byte) ([]byte, error)

func (*MemDB) Has

func (bt *MemDB) Has(key []byte) (bool, error)

func (*MemDB) Iterator

func (bt *MemDB) Iterator(start, end []byte) (store.Iterator, error)

func (*MemDB) NewBatch

func (db *MemDB) NewBatch() store.Batch

NewBatch returns a new memDBBatch.

func (*MemDB) NewBatchWithSize

func (db *MemDB) NewBatchWithSize(size int) store.Batch

NewBatchWithSize returns a new memDBBatch with the given size.

func (*MemDB) Print

func (db *MemDB) Print() error

func (*MemDB) ReverseIterator

func (bt *MemDB) ReverseIterator(start, end []byte) (store.Iterator, error)

func (*MemDB) Set

func (bt *MemDB) Set(key, value []byte) error

func (*MemDB) SetSync

func (bt *MemDB) SetSync(key, value []byte) error

func (*MemDB) Stats

func (db *MemDB) Stats() map[string]string

type MemEventsService

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

func EventsService

func EventsService(ctx context.Context, moduleName string) MemEventsService

EventsService attaches an event service to the context. Adding an existing module will reset the events.

func (MemEventsService) EventManager

func (e MemEventsService) EventManager(ctx context.Context) event.Manager

func (MemEventsService) GetEvents

func (e MemEventsService) GetEvents(ctx context.Context) []event.Event

func (MemEventsService) GetProtoEvents

func (e MemEventsService) GetProtoEvents(ctx context.Context) []transaction.Msg

type MemKV

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

MemKV a lightweight memory db

func NewMemKV

func NewMemKV() MemKV

NewMemKV creates a wrapper around `btree.BTreeG`.

func (MemKV) Delete

func (bt MemKV) Delete(key []byte) error

func (MemKV) Get

func (bt MemKV) Get(key []byte) ([]byte, error)

func (MemKV) Has

func (bt MemKV) Has(key []byte) (bool, error)

func (MemKV) Iterator

func (bt MemKV) Iterator(start, end []byte) (store.Iterator, error)

func (MemKV) ReverseIterator

func (bt MemKV) ReverseIterator(start, end []byte) (store.Iterator, error)

func (MemKV) Set

func (bt MemKV) Set(key, value []byte) error

Directories

Path Synopsis
Package gas is a generated GoMock package.
Package gas is a generated GoMock package.

Jump to

Keyboard shortcuts

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