Documentation
¶
Overview ¶
Package didstore is a generated GoMock package.
Index ¶
- func NewTestStore(t *testing.T) *store
- type MockStore
- func (m *MockStore) Add(didDocument did.Document, transaction Transaction) error
- func (m *MockStore) Conflicted(fn types.DocIterator) error
- func (m *MockStore) ConflictedCount() (uint, error)
- func (m *MockStore) DocumentCount() (uint, error)
- func (m *MockStore) EXPECT() *MockStoreMockRecorder
- func (m *MockStore) Iterate(fn types.DocIterator) error
- func (m *MockStore) Resolve(id did.DID, metadata *types.ResolveMetadata) (*did.Document, *types.DocumentMetadata, error)
- type MockStoreMockRecorder
- func (mr *MockStoreMockRecorder) Add(didDocument, transaction interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) Conflicted(fn interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) ConflictedCount() *gomock.Call
- func (mr *MockStoreMockRecorder) DocumentCount() *gomock.Call
- func (mr *MockStoreMockRecorder) Iterate(fn interface{}) *gomock.Call
- func (mr *MockStoreMockRecorder) Resolve(id, metadata interface{}) *gomock.Call
- type Store
- type Transaction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTestStore ¶
Types ¶
type MockStore ¶
type MockStore struct {
// contains filtered or unexported fields
}
MockStore is a mock of Store interface.
func NewMockStore ¶
func NewMockStore(ctrl *gomock.Controller) *MockStore
NewMockStore creates a new mock instance.
func (*MockStore) Add ¶
func (m *MockStore) Add(didDocument did.Document, transaction Transaction) error
Add mocks base method.
func (*MockStore) Conflicted ¶
func (m *MockStore) Conflicted(fn types.DocIterator) error
Conflicted mocks base method.
func (*MockStore) ConflictedCount ¶
ConflictedCount mocks base method.
func (*MockStore) DocumentCount ¶
DocumentCount mocks base method.
func (*MockStore) EXPECT ¶
func (m *MockStore) EXPECT() *MockStoreMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockStoreMockRecorder ¶
type MockStoreMockRecorder struct {
// contains filtered or unexported fields
}
MockStoreMockRecorder is the mock recorder for MockStore.
func (*MockStoreMockRecorder) Add ¶
func (mr *MockStoreMockRecorder) Add(didDocument, transaction interface{}) *gomock.Call
Add indicates an expected call of Add.
func (*MockStoreMockRecorder) Conflicted ¶
func (mr *MockStoreMockRecorder) Conflicted(fn interface{}) *gomock.Call
Conflicted indicates an expected call of Conflicted.
func (*MockStoreMockRecorder) ConflictedCount ¶
func (mr *MockStoreMockRecorder) ConflictedCount() *gomock.Call
ConflictedCount indicates an expected call of ConflictedCount.
func (*MockStoreMockRecorder) DocumentCount ¶
func (mr *MockStoreMockRecorder) DocumentCount() *gomock.Call
DocumentCount indicates an expected call of DocumentCount.
func (*MockStoreMockRecorder) Iterate ¶
func (mr *MockStoreMockRecorder) Iterate(fn interface{}) *gomock.Call
Iterate indicates an expected call of Iterate.
func (*MockStoreMockRecorder) Resolve ¶
func (mr *MockStoreMockRecorder) Resolve(id, metadata interface{}) *gomock.Call
Resolve indicates an expected call of Resolve.
type Store ¶
type Store interface {
// Add a DID Document to the store. The store will place it on the timeline and reprocess other versions if needed
Add(didDocument did.Document, transaction Transaction) error
// Conflicted iterates over all conflicted documents
Conflicted(fn vdr.DocIterator) error
// ConflictedCount returns the number of conflicted DID Documents
ConflictedCount() (uint, error)
// DocumentCount returns the number of DID Documents
DocumentCount() (uint, error)
// Iterate loops over all the latest versions of the stored DID Documents and applies fn.
// Calling any of the Store's functions from the given fn might cause a deadlock.
Iterate(fn vdr.DocIterator) error
// Resolve returns the DID Document for the provided DID.
// If metadata is not provided the latest version is returned.
// If metadata is provided then the result is filtered or scoped on that metadata.
// It returns vdr.ErrNotFound if there are no corresponding DID documents or when the DID Documents are disjoint with the provided ResolveMetadata.
// It returns vdr.ErrDeactivated if no metadata is given and the latest version of the DID Document is deactivated.
Resolve(id did.DID, metadata *vdr.ResolveMetadata) (*did.Document, *vdr.DocumentMetadata, error)
}
Store is the interface that groups all low level VDR DID storage operations.
type Transaction ¶
type Transaction event
Transaction is an alias to the didstore.event. Internally to the didstore it's an event based on a transaction. Using event as external name is very confusing, so there they are called transaction.
func TestTransaction ¶
func TestTransaction(document did.Document) Transaction