mocks

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Code generated by counterfeiter. DO NOT EDIT.

Code generated by counterfeiter. DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigManager

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

ConfigManager manages configuration in ledger

func NewConfigMgr

func NewConfigMgr() *ConfigManager

NewConfigMgr returns a new configuration manager

func (*ConfigManager) Delete

func (m *ConfigManager) Delete(key *config.Criteria) error

Delete deletes configuration from the ledger.

func (*ConfigManager) Query

func (m *ConfigManager) Query(criteria *config.Criteria) ([]*config.KeyValue, error)

Query retrieves configuration based on the provided config key.

func (*ConfigManager) Save

func (m *ConfigManager) Save(txID string, config *config.Config) error

Save saves the configuration to the ledger. The submitted payload should be in form of Config

func (*ConfigManager) WithError

func (m *ConfigManager) WithError(err error) *ConfigManager

WithError injects an error

func (*ConfigManager) WithQueryResults

func (m *ConfigManager) WithQueryResults(criteria *config.Criteria, results []*config.KeyValue) *ConfigManager

WithQueryResults sets the results for the given key

type KVResultsIter

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

KVResultsIter is a mock key-value results iterator

func NewKVResultsIter

func NewKVResultsIter(it commonledger.ResultsIterator) *KVResultsIter

NewKVResultsIter returns a new KVResultsIter

func (*KVResultsIter) Close

func (m *KVResultsIter) Close() error

Close closes the iterator

func (*KVResultsIter) HasNext

func (m *KVResultsIter) HasNext() bool

HasNext returns true if there are more items

func (*KVResultsIter) Next

func (m *KVResultsIter) Next() (*queryresult.KV, error)

Next returns the next item

func (*KVResultsIter) WithCloseError

func (m *KVResultsIter) WithCloseError(err error) *KVResultsIter

WithCloseError injects an error into the mock iterator

type StateRetriever

type StateRetriever struct {
	*mocks.QueryExecutor
	// contains filtered or unexported fields
}

StateRetriever is a mock implementation of StateRetriever

func NewStateRetriever

func NewStateRetriever() *StateRetriever

NewStateRetriever returns a mock StateRetriever

func (*StateRetriever) GetStateByPartialCompositeKey

func (m *StateRetriever) GetStateByPartialCompositeKey(namespace, objectType string, attributes []string) (api.ResultsIterator, error)

GetStateByPartialCompositeKey returns an iterator for the range of keys/values for the given partial keys

func (*StateRetriever) WithKVResultsIteratorProvider

func (m *StateRetriever) WithKVResultsIteratorProvider(p func(it commonledger.ResultsIterator) *KVResultsIter) *StateRetriever

WithKVResultsIteratorProvider sets the KV results iterator provider

type StateRetrieverProvider

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

StateRetrieverProvider is a mock implementation of RetrieverProvider

func NewStateRetrieverProvider

func NewStateRetrieverProvider() *StateRetrieverProvider

NewStateRetrieverProvider returns a mock StateRetrieverProvider

func (*StateRetrieverProvider) GetStateRetriever

func (m *StateRetrieverProvider) GetStateRetriever() (api.StateRetriever, error)

GetStateRetriever returns a mock StateRetriever

func (*StateRetrieverProvider) WithError

WithError injects the provider with an error

func (*StateRetrieverProvider) WithStateRetriever

WithStateRetriever sets the StateRetriever

type StateStore

type StateStore struct {
	*StateRetriever
	// contains filtered or unexported fields
}

StateStore is a mock StateStore

func NewStateStore

func NewStateStore() *StateStore

NewStateStore returns a mock StateStore

func (*StateStore) DelState

func (m *StateStore) DelState(namespace, key string) error

DelState deletes the given key

func (*StateStore) PutState

func (m *StateStore) PutState(namespace, key string, value []byte) error

PutState saves the given state

func (*StateStore) WithRetrieverError

func (m *StateStore) WithRetrieverError(err error) *StateStore

WithRetrieverError injects the state retriever with an error

func (*StateStore) WithStoreError

func (m *StateStore) WithStoreError(err error) *StateStore

WithStoreError injects the state store with an error

type StoreProvider

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

StoreProvider is a mock StoreProvider

func NewStoreProvider

func NewStoreProvider() *StoreProvider

NewStoreProvider returns a mock StoreProvider

func (*StoreProvider) GetStateRetriever

func (m *StoreProvider) GetStateRetriever() (api.StateRetriever, error)

GetStateRetriever returns a mock StateRetriever

func (*StoreProvider) GetStore

func (m *StoreProvider) GetStore() (api.StateStore, error)

GetStore returns a mock StateStore

func (*StoreProvider) WithError

func (m *StoreProvider) WithError(err error) *StoreProvider

WithError injects the store provider with an error

func (*StoreProvider) WithStore

func (m *StoreProvider) WithStore(store api.StateStore) *StoreProvider

WithStore sets the StateStore

type Validator added in v0.1.2

type Validator struct {
	ValidateStub func(kv *config.KeyValue) error
	// contains filtered or unexported fields
}

func (*Validator) Invocations added in v0.1.2

func (fake *Validator) Invocations() map[string][][]interface{}

func (*Validator) Validate added in v0.1.2

func (fake *Validator) Validate(kv *config.KeyValue) error

func (*Validator) ValidateArgsForCall added in v0.1.2

func (fake *Validator) ValidateArgsForCall(i int) *config.KeyValue

func (*Validator) ValidateCallCount added in v0.1.2

func (fake *Validator) ValidateCallCount() int

func (*Validator) ValidateReturns added in v0.1.2

func (fake *Validator) ValidateReturns(result1 error)

func (*Validator) ValidateReturnsOnCall added in v0.1.2

func (fake *Validator) ValidateReturnsOnCall(i int, result1 error)

type ValidatorRegistry added in v0.1.2

type ValidatorRegistry struct {
	ValidatorForKeyStub func(key *config.Key) config.Validator
	// contains filtered or unexported fields
}

func (*ValidatorRegistry) Invocations added in v0.1.2

func (fake *ValidatorRegistry) Invocations() map[string][][]interface{}

func (*ValidatorRegistry) ValidatorForKey added in v0.1.2

func (fake *ValidatorRegistry) ValidatorForKey(key *config.Key) config.Validator

func (*ValidatorRegistry) ValidatorForKeyArgsForCall added in v0.1.2

func (fake *ValidatorRegistry) ValidatorForKeyArgsForCall(i int) *config.Key

func (*ValidatorRegistry) ValidatorForKeyCallCount added in v0.1.2

func (fake *ValidatorRegistry) ValidatorForKeyCallCount() int

func (*ValidatorRegistry) ValidatorForKeyReturns added in v0.1.2

func (fake *ValidatorRegistry) ValidatorForKeyReturns(result1 config.Validator)

func (*ValidatorRegistry) ValidatorForKeyReturnsOnCall added in v0.1.2

func (fake *ValidatorRegistry) ValidatorForKeyReturnsOnCall(i int, result1 config.Validator)

Jump to

Keyboard shortcuts

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