didstore

package
v5.4.40 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Overview

Package didstore is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTestStore

func NewTestStore(t *testing.T) *store

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

func (m *MockStore) ConflictedCount() (uint, error)

ConflictedCount mocks base method.

func (*MockStore) DocumentCount

func (m *MockStore) DocumentCount() (uint, error)

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) Iterate

func (m *MockStore) Iterate(fn types.DocIterator) error

Iterate mocks base method.

func (*MockStore) Resolve

func (m *MockStore) Resolve(id did.DID, metadata *types.ResolveMetadata) (*did.Document, *types.DocumentMetadata, error)

Resolve 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 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.

func New

func New(storageProvider storage.Provider) Store

New returns a new vdrStore.Store that still needs to be initialized

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

Jump to

Keyboard shortcuts

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