storage

package
v1.4.18 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetStorageManagerArgsAndOptions

func GetStorageManagerArgsAndOptions() (trie.NewTrieStorageManagerArgs, trie.StorageManagerOptions)

GetStorageManagerArgsAndOptions returns mock args for trie storage manager creation

Types

type ChainStorerStub

type ChainStorerStub struct {
	AddStorerCalled     func(key dataRetriever.UnitType, s storage.Storer)
	GetStorerCalled     func(unitType dataRetriever.UnitType) (storage.Storer, error)
	HasCalled           func(unitType dataRetriever.UnitType, key []byte) error
	GetCalled           func(unitType dataRetriever.UnitType, key []byte) ([]byte, error)
	PutCalled           func(unitType dataRetriever.UnitType, key []byte, value []byte) error
	GetAllCalled        func(unitType dataRetriever.UnitType, keys [][]byte) (map[string][]byte, error)
	GetAllStorersCalled func() map[dataRetriever.UnitType]storage.Storer
	DestroyCalled       func() error
	CloseAllCalled      func() error
}

ChainStorerStub -

func (*ChainStorerStub) AddStorer

func (stub *ChainStorerStub) AddStorer(key dataRetriever.UnitType, s storage.Storer)

AddStorer -

func (*ChainStorerStub) CloseAll

func (stub *ChainStorerStub) CloseAll() error

CloseAll -

func (*ChainStorerStub) Destroy

func (stub *ChainStorerStub) Destroy() error

Destroy -

func (*ChainStorerStub) Get

func (stub *ChainStorerStub) Get(unitType dataRetriever.UnitType, key []byte) ([]byte, error)

Get -

func (*ChainStorerStub) GetAll

func (stub *ChainStorerStub) GetAll(unitType dataRetriever.UnitType, keys [][]byte) (map[string][]byte, error)

GetAll -

func (*ChainStorerStub) GetAllStorers

func (stub *ChainStorerStub) GetAllStorers() map[dataRetriever.UnitType]storage.Storer

GetAllStorers -

func (*ChainStorerStub) GetStorer

func (stub *ChainStorerStub) GetStorer(unitType dataRetriever.UnitType) (storage.Storer, error)

GetStorer -

func (*ChainStorerStub) Has

func (stub *ChainStorerStub) Has(unitType dataRetriever.UnitType, key []byte) error

Has -

func (*ChainStorerStub) IsInterfaceNil

func (stub *ChainStorerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*ChainStorerStub) Put

func (stub *ChainStorerStub) Put(unitType dataRetriever.UnitType, key []byte, value []byte) error

Put -

func (*ChainStorerStub) SetEpochForPutOperation

func (stub *ChainStorerStub) SetEpochForPutOperation(_ uint32)

SetEpochForPutOperation -

type StorerStub

type StorerStub struct {
	PutCalled                    func(key, data []byte) error
	PutInEpochCalled             func(key, data []byte, epoch uint32) error
	GetCalled                    func(key []byte) ([]byte, error)
	HasCalled                    func(key []byte) error
	SearchFirstCalled            func(key []byte) ([]byte, error)
	RemoveFromCurrentEpochCalled func(key []byte) error
	RemoveCalled                 func(key []byte) error
	ClearCacheCalled             func()
	DestroyUnitCalled            func() error
	GetFromEpochCalled           func(key []byte, epoch uint32) ([]byte, error)
	GetBulkFromEpochCalled       func(keys [][]byte, epoch uint32) ([]storage.KeyValuePair, error)
	GetOldestEpochCalled         func() (uint32, error)
	RangeKeysCalled              func(handler func(key []byte, val []byte) bool)
	CloseCalled                  func() error
}

StorerStub -

func (*StorerStub) ClearCache

func (ss *StorerStub) ClearCache()

ClearCache -

func (*StorerStub) Close

func (ss *StorerStub) Close() error

Close -

func (*StorerStub) DestroyUnit

func (ss *StorerStub) DestroyUnit() error

DestroyUnit -

func (*StorerStub) Get

func (ss *StorerStub) Get(key []byte) ([]byte, error)

Get -

func (*StorerStub) GetBulkFromEpoch

func (ss *StorerStub) GetBulkFromEpoch(keys [][]byte, epoch uint32) ([]storage.KeyValuePair, error)

GetBulkFromEpoch -

func (*StorerStub) GetFromEpoch

func (ss *StorerStub) GetFromEpoch(key []byte, epoch uint32) ([]byte, error)

GetFromEpoch -

func (*StorerStub) GetOldestEpoch

func (ss *StorerStub) GetOldestEpoch() (uint32, error)

GetOldestEpoch -

func (*StorerStub) Has

func (ss *StorerStub) Has(key []byte) error

Has -

func (*StorerStub) IsInterfaceNil

func (ss *StorerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*StorerStub) Put

func (ss *StorerStub) Put(key, data []byte) error

Put -

func (*StorerStub) PutInEpoch

func (ss *StorerStub) PutInEpoch(key, data []byte, epoch uint32) error

PutInEpoch -

func (*StorerStub) RangeKeys

func (ss *StorerStub) RangeKeys(handler func(key []byte, val []byte) bool)

RangeKeys -

func (*StorerStub) Remove

func (ss *StorerStub) Remove(key []byte) error

Remove -

func (*StorerStub) RemoveFromCurrentEpoch

func (ss *StorerStub) RemoveFromCurrentEpoch(key []byte) error

RemoveFromCurrentEpoch -

func (*StorerStub) SearchFirst

func (ss *StorerStub) SearchFirst(key []byte) ([]byte, error)

SearchFirst -

type UnitOpenerStub

type UnitOpenerStub struct {
	OpenDBCalled                   func(dbConfig config.DBConfig, shardID uint32, epoch uint32) (storage.Storer, error)
	GetMostRecentStorageUnitCalled func(config config.DBConfig) (storage.Storer, error)
}

UnitOpenerStub -

func (*UnitOpenerStub) GetMostRecentStorageUnit

func (uohs *UnitOpenerStub) GetMostRecentStorageUnit(config config.DBConfig) (storage.Storer, error)

GetMostRecentStorageUnit -

func (*UnitOpenerStub) IsInterfaceNil

func (uohs *UnitOpenerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*UnitOpenerStub) OpenDB

func (uohs *UnitOpenerStub) OpenDB(dbConfig config.DBConfig, shardID uint32, epoch uint32) (storage.Storer, error)

OpenDB -

Jump to

Keyboard shortcuts

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