mocks

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store implements a mock store

func NewStore

func NewStore() *Store

NewStore returns a mock transient data store

func (*Store) Close

func (m *Store) Close()

Close closes the store

func (*Store) Data

func (m *Store) Data(key *storeapi.Key, value *storeapi.ExpiringValue) *Store

Data sets the data for the given key

func (*Store) Error

func (m *Store) Error(err error) *Store

Error sets an err

func (*Store) GetData

func (m *Store) GetData(key *storeapi.Key) (*storeapi.ExpiringValue, error)

GetData gets the value for the given item

func (*Store) GetDataMultipleKeys

func (m *Store) GetDataMultipleKeys(key *storeapi.MultiKey) (storeapi.ExpiringValues, error)

GetDataMultipleKeys gets the values for the multiple items in a single call

func (*Store) Persist

func (m *Store) Persist(txid string, privateSimulationResultsWithConfig *proto.TxPvtReadWriteSetWithConfigInfo) error

Persist stores the private write set of a transaction along with the collection config in the transient store based on txid and the block height the private data was received at

func (*Store) PutData

func (m *Store) PutData(config *pb.StaticCollectionConfig, key *storeapi.Key, value *storeapi.ExpiringValue) error

PutData stores the key/value

func (*Store) Query

Query executes the given rich query

func (*Store) ResultsIteratorError

func (m *Store) ResultsIteratorError(err error) *Store

ResultsIteratorError sets an error on the results iterator

func (*Store) WithQueryResults

func (m *Store) WithQueryResults(key *storeapi.QueryKey, results []*storeapi.QueryResult) *Store

WithQueryResults sets the mock query results for the given query string

type StoreProvider

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

StoreProvider implements a mock transient data store provider

func NewOffLedgerStoreProvider

func NewOffLedgerStoreProvider() *StoreProvider

NewOffLedgerStoreProvider returns a new provider

func (*StoreProvider) Close

func (p *StoreProvider) Close()

Close closes the store for the given channel

func (*StoreProvider) Data

Data invokes the Data of the store for the given key and value

func (*StoreProvider) Error

func (p *StoreProvider) Error(err error) *StoreProvider

Error stores the error

func (*StoreProvider) IsStoreClosed

func (p *StoreProvider) IsStoreClosed() bool

IsStoreClosed indicates whether the store is closed

func (*StoreProvider) OpenStore

func (p *StoreProvider) OpenStore(channelID string) (olapi.Store, error)

OpenStore opens the transient data store for the given channel

func (*StoreProvider) ResultsIteratorError

func (p *StoreProvider) ResultsIteratorError(err error) *StoreProvider

ResultsIteratorError injects an error on the results iterator

func (*StoreProvider) StoreError

func (p *StoreProvider) StoreError(err error) *StoreProvider

StoreError stores the storeError

func (*StoreProvider) StoreForChannel

func (p *StoreProvider) StoreForChannel(channelID string) olapi.Store

StoreForChannel returns the transient data store for the given channel

func (*StoreProvider) WithQueryResults

func (p *StoreProvider) WithQueryResults(key *storeapi.QueryKey, results []*storeapi.QueryResult) *StoreProvider

WithQueryResults sets the mock query results for the given query string

type TransientDataStore

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

TransientDataStore implements a mock transient data store

func NewTransientDataStore

func NewTransientDataStore() *TransientDataStore

NewTransientDataStore returns a mock transient data store

func (*TransientDataStore) Close

func (m *TransientDataStore) Close()

Close closes the store

func (*TransientDataStore) Data

Data sets the transient data for the given key

func (*TransientDataStore) Error

Error sets an err

func (*TransientDataStore) GetTransientData

func (m *TransientDataStore) GetTransientData(key *storeapi.Key) (*storeapi.ExpiringValue, error)

GetTransientData gets the value for the given transient data item

func (*TransientDataStore) GetTransientDataMultipleKeys

func (m *TransientDataStore) GetTransientDataMultipleKeys(key *storeapi.MultiKey) (storeapi.ExpiringValues, error)

GetTransientDataMultipleKeys gets the values for the multiple transient data items in a single call

func (*TransientDataStore) Persist

func (m *TransientDataStore) Persist(txid string, privateSimulationResultsWithConfig *proto.TxPvtReadWriteSetWithConfigInfo) error

Persist stores the private write set of a transaction along with the collection config in the transient store based on txid and the block height the private data was received at

type TransientDataStoreProvider

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

TransientDataStoreProvider implements a mock transient data store provider

func NewTransientDataStoreProvider

func NewTransientDataStoreProvider() *TransientDataStoreProvider

NewTransientDataStoreProvider creates a new provider

func (*TransientDataStoreProvider) Close

func (p *TransientDataStoreProvider) Close()

Close closes the transient data store for the given channel

func (*TransientDataStoreProvider) Data

Data stores key value

func (*TransientDataStoreProvider) Error

Error stores the error

func (*TransientDataStoreProvider) IsStoreClosed

func (p *TransientDataStoreProvider) IsStoreClosed() bool

IsStoreClosed indicates whether the transient data store is closed

func (*TransientDataStoreProvider) OpenStore

func (p *TransientDataStoreProvider) OpenStore(channelID string) (tdapi.Store, error)

OpenStore opens the transient data store for the given channel

func (*TransientDataStoreProvider) StoreError

StoreError stores the StoreError

func (*TransientDataStoreProvider) StoreForChannel

func (p *TransientDataStoreProvider) StoreForChannel(channelID string) tdapi.Store

StoreForChannel returns the transient data store for the given channel

Jump to

Keyboard shortcuts

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