Documentation ¶
Index ¶
- type MockBlockchainClient
- type MockCasClient
- type MockDocumentHandler
- func (m *MockDocumentHandler) Namespace() string
- func (m *MockDocumentHandler) ProcessOperation(operation batch.Operation) (document.Document, error)
- func (m *MockDocumentHandler) Protocol() protocol.Client
- func (m *MockDocumentHandler) ResolveDocument(idOrDocument string) (document.Document, error)
- func (m *MockDocumentHandler) WithError(err error) *MockDocumentHandler
- func (m *MockDocumentHandler) WithNamespace(ns string) *MockDocumentHandler
- func (m *MockDocumentHandler) WithProtocolClient(client protocol.Client) *MockDocumentHandler
- type MockOperationStore
- type MockProtocolClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockBlockchainClient ¶
MockBlockchainClient mocks blockchain client for testing purposes.
func NewMockBlockchainClient ¶
func NewMockBlockchainClient(err error) *MockBlockchainClient
NewMockBlockchainClient creates mock client
func (*MockBlockchainClient) GetAnchors ¶
func (m *MockBlockchainClient) GetAnchors() []string
GetAnchors returns anchors
func (*MockBlockchainClient) Read ¶
func (m *MockBlockchainClient) Read(sinceTransactionNumber int) (bool, *observer.SidetreeTxn)
func (*MockBlockchainClient) WriteAnchor ¶
func (m *MockBlockchainClient) WriteAnchor(anchorFileHash string) error
WriteAnchor writes the anchor file hash as a transaction to blockchain.
type MockCasClient ¶
MockCasClient mocks CAS for testing purposes.
func NewMockCasClient ¶
func NewMockCasClient(err error) *MockCasClient
NewMockCasClient creates mock client
func (*MockCasClient) GetError ¶
func (m *MockCasClient) GetError() error
GetError returns the injected error
func (*MockCasClient) Read ¶
func (m *MockCasClient) Read(address string) ([]byte, error)
Read reads the content of the given address in CAS. returns the content of the given address.
func (*MockCasClient) SetError ¶
func (m *MockCasClient) SetError(err error)
SetError injects an error into the mock client
type MockDocumentHandler ¶
type MockDocumentHandler struct {
// contains filtered or unexported fields
}
MockDocumentHandler mocks the document handler
func NewMockDocumentHandler ¶
func NewMockDocumentHandler() *MockDocumentHandler
NewMockDocumentHandler returns a new mock document handler
func (*MockDocumentHandler) Namespace ¶
func (m *MockDocumentHandler) Namespace() string
Namespace returns the namespace
func (*MockDocumentHandler) ProcessOperation ¶
func (m *MockDocumentHandler) ProcessOperation(operation batch.Operation) (document.Document, error)
ProcessOperation mocks process operation
func (*MockDocumentHandler) Protocol ¶
func (m *MockDocumentHandler) Protocol() protocol.Client
Protocol returns the Protocol
func (*MockDocumentHandler) ResolveDocument ¶
func (m *MockDocumentHandler) ResolveDocument(idOrDocument string) (document.Document, error)
ResolveDocument mocks resolve document
func (*MockDocumentHandler) WithError ¶
func (m *MockDocumentHandler) WithError(err error) *MockDocumentHandler
WithError injects an error into the mock handler
func (*MockDocumentHandler) WithNamespace ¶
func (m *MockDocumentHandler) WithNamespace(ns string) *MockDocumentHandler
WithNamespace sets the namespace
func (*MockDocumentHandler) WithProtocolClient ¶
func (m *MockDocumentHandler) WithProtocolClient(client protocol.Client) *MockDocumentHandler
WithProtocolClient sets the protocol client
type MockOperationStore ¶
type MockOperationStore struct { sync.RWMutex Err error Validate bool // contains filtered or unexported fields }
MockOperationStore mocks store for testing purposes.
func NewMockOperationStore ¶
func NewMockOperationStore(err error) *MockOperationStore
NewMockOperationStore creates mock operations store
type MockProtocolClient ¶
MockProtocolClient mocks protocol for testing purposes.
func NewMockProtocolClient ¶
func NewMockProtocolClient() *MockProtocolClient
NewMockProtocolClient creates mocks protocol client
func (*MockProtocolClient) Current ¶
func (m *MockProtocolClient) Current() protocol.Protocol
Current mocks getting last protocol version