Documentation
¶
Index ¶
- type MockDCASClient
- type MockOffLedgerClient
- func (m *MockOffLedgerClient) Get(ns, coll, key string) ([]byte, error)
- func (m *MockOffLedgerClient) GetMap(ns, coll string) (map[string][]byte, error)
- func (m *MockOffLedgerClient) Put(ns, coll, key string, content []byte) error
- func (m *MockOffLedgerClient) WithGetError(err error) *MockOffLedgerClient
- func (m *MockOffLedgerClient) WithGetErrorForKey(ns, coll, key string, err error) *MockOffLedgerClient
- func (m *MockOffLedgerClient) WithPutError(err error) *MockOffLedgerClient
- func (m *MockOffLedgerClient) WithPutErrorForKey(ns, coll, key string, err error) *MockOffLedgerClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockDCASClient ¶
type MockDCASClient struct {
*MockOffLedgerClient
}
MockDCASClient mocks DCAS for testing purposes.
func NewMockDCASClient ¶
func NewMockDCASClient() *MockDCASClient
NewMockDCASClient creates mock DCAS client
type MockOffLedgerClient ¶
type MockOffLedgerClient struct { sync.RWMutex PutErr error GetErr error // contains filtered or unexported fields }
MockOffLedgerClient mocks the off-ledger client
func NewMockOffLedgerClient ¶
func NewMockOffLedgerClient() *MockOffLedgerClient
NewMockOffLedgerClient creates a mock off-ledger client
func (*MockOffLedgerClient) Get ¶
func (m *MockOffLedgerClient) Get(ns, coll, key string) ([]byte, error)
Get retrieves the value from mock content addressable storage
func (*MockOffLedgerClient) GetMap ¶
func (m *MockOffLedgerClient) GetMap(ns, coll string) (map[string][]byte, error)
GetMap retrieves all values for namespace and collection
func (*MockOffLedgerClient) Put ¶
func (m *MockOffLedgerClient) Put(ns, coll, key string, content []byte) error
Put stores content in the off-ledger store
func (*MockOffLedgerClient) WithGetError ¶
func (m *MockOffLedgerClient) WithGetError(err error) *MockOffLedgerClient
WithGetError injects an error when a call is made to get a value
func (*MockOffLedgerClient) WithGetErrorForKey ¶
func (m *MockOffLedgerClient) WithGetErrorForKey(ns, coll, key string, err error) *MockOffLedgerClient
WithGetErrorForKey injects an error when a call is made to get a value for the given namespace, collection, and key
func (*MockOffLedgerClient) WithPutError ¶
func (m *MockOffLedgerClient) WithPutError(err error) *MockOffLedgerClient
WithPutError injects an error when a call is made to put a value
func (*MockOffLedgerClient) WithPutErrorForKey ¶
func (m *MockOffLedgerClient) WithPutErrorForKey(ns, coll, key string, err error) *MockOffLedgerClient
WithPutErrorForKey injects an error when a call is made to put a value for the given namespace, collection, and key