Documentation
¶
Overview ¶
Package didstore is a generated GoMock package.
Index ¶
- func NewTestStore(t *testing.T) *store
- func TestStore(t *testing.T, storageEngine storage.Engine) *store
- type Finder
- type MockStore
- func (m *MockStore) Add(didDocument did.Document, transaction Transaction) error
- func (m *MockStore) Conflicted(fn resolver.DocIterator) error
- func (m *MockStore) ConflictedCount() (uint, error)
- func (m *MockStore) DocumentCount() (uint, error)
- func (m *MockStore) EXPECT() *MockStoreMockRecorder
- func (m *MockStore) HistorySinceVersion(id did.DID, version int) ([]orm.MigrationDocument, error)
- func (m *MockStore) Iterate(fn resolver.DocIterator) error
- func (m *MockStore) Resolve(id did.DID, metadata *resolver.ResolveMetadata) (*did.Document, *resolver.DocumentMetadata, error)
- type MockStoreMockRecorder
- func (mr *MockStoreMockRecorder) Add(didDocument, transaction any) *gomock.Call
- func (mr *MockStoreMockRecorder) Conflicted(fn any) *gomock.Call
- func (mr *MockStoreMockRecorder) ConflictedCount() *gomock.Call
- func (mr *MockStoreMockRecorder) DocumentCount() *gomock.Call
- func (mr *MockStoreMockRecorder) HistorySinceVersion(id, version any) *gomock.Call
- func (mr *MockStoreMockRecorder) Iterate(fn any) *gomock.Call
- func (mr *MockStoreMockRecorder) Resolve(id, metadata any) *gomock.Call
- type Store
- type Transaction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTestStore ¶
NewTestStore creates a new store for testing It also creates a new storage engine for testing
Types ¶
type Finder ¶
type Finder struct {
Store Store
}
Finder is a helper that implements the DocFinder interface
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 resolver.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.
func (*MockStore) HistorySinceVersion ¶
HistorySinceVersion mocks base method.
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 any) *gomock.Call
Add indicates an expected call of Add.
func (*MockStoreMockRecorder) Conflicted ¶
func (mr *MockStoreMockRecorder) Conflicted(fn any) *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) HistorySinceVersion ¶
func (mr *MockStoreMockRecorder) HistorySinceVersion(id, version any) *gomock.Call
HistorySinceVersion indicates an expected call of HistorySinceVersion.
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 resolver.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 resolver.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 *resolver.ResolveMetadata) (*did.Document, *resolver.DocumentMetadata, error)
// HistorySinceVersion returns all versions of the DID Document since the specified version (including version).
// The slice is empty when version is the most recent version of the DID Document.
// The history contains DID Documents as they were published, which differs from Resolve that produces a merge of conflicted documents.
// DEPRECATED: This function exists to migrate the history of owned DIDs from key-value storage to SQL storage.
HistorySinceVersion(id did.DID, version int) ([]orm.MigrationDocument, 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