mocks

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2021 License: Apache-2.0 Imports: 25 Imported by: 1

Documentation

Overview

Code generated by counterfeiter. DO NOT EDIT.

Code generated by counterfeiter. DO NOT EDIT.

Code generated by counterfeiter. DO NOT EDIT.

Index

Constants

View Source
const DefaultNS = "did:sidetree"

DefaultNS is default namespace used in mocks.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnchorGraph added in v0.1.2

type AnchorGraph struct {
	ReadStub func(cid string) (*verifiable.Credential, error)

	GetDidAnchorsStub func(cid, suffix string) ([]graph.Anchor, error)
	// contains filtered or unexported fields
}

func (*AnchorGraph) GetDidAnchors added in v0.1.2

func (fake *AnchorGraph) GetDidAnchors(cid string, suffix string) ([]graph.Anchor, error)

func (*AnchorGraph) GetDidAnchorsArgsForCall added in v0.1.2

func (fake *AnchorGraph) GetDidAnchorsArgsForCall(i int) (string, string)

func (*AnchorGraph) GetDidAnchorsCallCount added in v0.1.2

func (fake *AnchorGraph) GetDidAnchorsCallCount() int

func (*AnchorGraph) GetDidAnchorsReturns added in v0.1.2

func (fake *AnchorGraph) GetDidAnchorsReturns(result1 []graph.Anchor, result2 error)

func (*AnchorGraph) GetDidAnchorsReturnsOnCall added in v0.1.2

func (fake *AnchorGraph) GetDidAnchorsReturnsOnCall(i int, result1 []graph.Anchor, result2 error)

func (*AnchorGraph) Invocations added in v0.1.2

func (fake *AnchorGraph) Invocations() map[string][][]interface{}

func (*AnchorGraph) Read added in v0.1.2

func (fake *AnchorGraph) Read(cid string) (*verifiable.Credential, error)

func (*AnchorGraph) ReadArgsForCall added in v0.1.2

func (fake *AnchorGraph) ReadArgsForCall(i int) string

func (*AnchorGraph) ReadCallCount added in v0.1.2

func (fake *AnchorGraph) ReadCallCount() int

func (*AnchorGraph) ReadReturns added in v0.1.2

func (fake *AnchorGraph) ReadReturns(result1 *verifiable.Credential, result2 error)

func (*AnchorGraph) ReadReturnsOnCall added in v0.1.2

func (fake *AnchorGraph) ReadReturnsOnCall(i int, result1 *verifiable.Credential, result2 error)

type ClientVersion added in v0.1.2

type ClientVersion struct {
	OperationProviderStub func() protocol.OperationProvider

	ProtocolStub func() protocol.Protocol

	VersionStub func() string
	// contains filtered or unexported fields
}

func (*ClientVersion) Invocations added in v0.1.2

func (fake *ClientVersion) Invocations() map[string][][]interface{}

func (*ClientVersion) OperationProvider added in v0.1.2

func (fake *ClientVersion) OperationProvider() protocol.OperationProvider

func (*ClientVersion) OperationProviderCallCount added in v0.1.2

func (fake *ClientVersion) OperationProviderCallCount() int

func (*ClientVersion) OperationProviderCalls added in v0.1.2

func (fake *ClientVersion) OperationProviderCalls(stub func() protocol.OperationProvider)

func (*ClientVersion) OperationProviderReturns added in v0.1.2

func (fake *ClientVersion) OperationProviderReturns(result1 protocol.OperationProvider)

func (*ClientVersion) OperationProviderReturnsOnCall added in v0.1.2

func (fake *ClientVersion) OperationProviderReturnsOnCall(i int, result1 protocol.OperationProvider)

func (*ClientVersion) Protocol added in v0.1.2

func (fake *ClientVersion) Protocol() protocol.Protocol

func (*ClientVersion) ProtocolCallCount added in v0.1.2

func (fake *ClientVersion) ProtocolCallCount() int

func (*ClientVersion) ProtocolCalls added in v0.1.2

func (fake *ClientVersion) ProtocolCalls(stub func() protocol.Protocol)

func (*ClientVersion) ProtocolReturns added in v0.1.2

func (fake *ClientVersion) ProtocolReturns(result1 protocol.Protocol)

func (*ClientVersion) ProtocolReturnsOnCall added in v0.1.2

func (fake *ClientVersion) ProtocolReturnsOnCall(i int, result1 protocol.Protocol)

func (*ClientVersion) Version added in v0.1.2

func (fake *ClientVersion) Version() string

func (*ClientVersion) VersionCallCount added in v0.1.2

func (fake *ClientVersion) VersionCallCount() int

func (*ClientVersion) VersionCalls added in v0.1.2

func (fake *ClientVersion) VersionCalls(stub func() string)

func (*ClientVersion) VersionReturns added in v0.1.2

func (fake *ClientVersion) VersionReturns(result1 string)

func (*ClientVersion) VersionReturnsOnCall added in v0.1.2

func (fake *ClientVersion) VersionReturnsOnCall(i int, result1 string)

type MetricsProvider added in v0.1.3

type MetricsProvider struct{}

MetricsProvider implements a mock ActivityPub metrics provider.

func (*MetricsProvider) AddOperationTime added in v0.1.3

func (m *MetricsProvider) AddOperationTime(value time.Duration)

AddOperationTime records the time it takes to add an operation to the queue.

func (*MetricsProvider) AddProofParseCredential added in v0.1.3

func (m *MetricsProvider) AddProofParseCredential(value time.Duration)

AddProofParseCredential records vct parse credential in add proof.

func (*MetricsProvider) AddProofSign added in v0.1.3

func (m *MetricsProvider) AddProofSign(value time.Duration)

AddProofSign records vct sign in add proof.

func (*MetricsProvider) BatchAckTime added in v0.1.3

func (m *MetricsProvider) BatchAckTime(value time.Duration)

BatchAckTime records the time to acknowledge all of the operations that are removed from the queue.

func (*MetricsProvider) BatchCutTime added in v0.1.3

func (m *MetricsProvider) BatchCutTime(value time.Duration)

BatchCutTime records the time it takes to cut an operation batch.

func (*MetricsProvider) BatchNackTime added in v0.1.3

func (m *MetricsProvider) BatchNackTime(value time.Duration)

BatchNackTime records the time to nack all of the operations that are to be placed back on the queue.

func (*MetricsProvider) BatchRollbackTime added in v0.1.3

func (m *MetricsProvider) BatchRollbackTime(value time.Duration)

BatchRollbackTime records the time it takes to roll back an operation batch (in case of a transient error).

func (*MetricsProvider) BatchSize added in v0.1.3

func (m *MetricsProvider) BatchSize(float64)

BatchSize records the size of an operation batch.

func (*MetricsProvider) CASIncrementCacheHitCount added in v0.1.3

func (m *MetricsProvider) CASIncrementCacheHitCount()

CASIncrementCacheHitCount increments the number of CAS cache hits.

func (*MetricsProvider) CASReadTime added in v0.1.3

func (m *MetricsProvider) CASReadTime(casType string, value time.Duration)

CASReadTime records the time it takes to read a document from CAS storage.

func (*MetricsProvider) CASResolveTime added in v0.1.3

func (m *MetricsProvider) CASResolveTime(value time.Duration)

CASResolveTime records the time it takes to resolve a document from CAS.

func (*MetricsProvider) CASWriteTime added in v0.1.3

func (m *MetricsProvider) CASWriteTime(value time.Duration)

CASWriteTime records the time it takes to write a document to CAS.

func (*MetricsProvider) DocumentCreateUpdateTime added in v0.1.3

func (m *MetricsProvider) DocumentCreateUpdateTime(value time.Duration)

DocumentCreateUpdateTime records the time it takes the REST handler to process a create/update operation.

func (*MetricsProvider) DocumentResolveTime added in v0.1.3

func (m *MetricsProvider) DocumentResolveTime(value time.Duration)

DocumentResolveTime records the time it takes the REST handler to resolve a document.

func (*MetricsProvider) InboxHandlerTime added in v0.1.3

func (m *MetricsProvider) InboxHandlerTime(activityType string, value time.Duration)

InboxHandlerTime records the time it takes to handle an activity posted to the inbox.

func (*MetricsProvider) OutboxIncrementActivityCount added in v0.1.3

func (m *MetricsProvider) OutboxIncrementActivityCount(activityType string)

OutboxIncrementActivityCount increments the number of activities of the given type posted to the outbox.

func (*MetricsProvider) OutboxPostTime added in v0.1.3

func (m *MetricsProvider) OutboxPostTime(value time.Duration)

OutboxPostTime records the time it takes to post a message to the outbox.

func (*MetricsProvider) OutboxResolveInboxesTime added in v0.1.3

func (m *MetricsProvider) OutboxResolveInboxesTime(value time.Duration)

OutboxResolveInboxesTime records the time it takes to resolve inboxes for an outbox post.

func (*MetricsProvider) ProcessAnchorTime added in v0.1.3

func (m *MetricsProvider) ProcessAnchorTime(value time.Duration)

ProcessAnchorTime records the time it takes for the Observer to process an anchor credential.

func (*MetricsProvider) ProcessDIDTime added in v0.1.3

func (m *MetricsProvider) ProcessDIDTime(value time.Duration)

ProcessDIDTime records the time it takes for the Observer to process a DID.

func (*MetricsProvider) ProcessWitnessedAnchorCredentialTime added in v0.1.3

func (m *MetricsProvider) ProcessWitnessedAnchorCredentialTime(value time.Duration)

ProcessWitnessedAnchorCredentialTime records the time it takes to process a witnessed anchor credential by publishing it to the Observer and posting a 'Create' activity.

func (*MetricsProvider) SignerAddLinkedDataProof added in v0.1.3

func (m *MetricsProvider) SignerAddLinkedDataProof(value time.Duration)

SignerAddLinkedDataProof records add data linked proof.

func (*MetricsProvider) SignerGetKey added in v0.1.3

func (m *MetricsProvider) SignerGetKey(value time.Duration)

SignerGetKey records get key time.

func (*MetricsProvider) SignerSign added in v0.1.3

func (m *MetricsProvider) SignerSign(value time.Duration)

SignerSign records sign time.

func (*MetricsProvider) WitnessAddProof added in v0.1.3

func (m *MetricsProvider) WitnessAddProof(value time.Duration)

WitnessAddProof records vct witness add proof.

func (*MetricsProvider) WitnessAddProofVctNil added in v0.1.3

func (m *MetricsProvider) WitnessAddProofVctNil(value time.Duration)

WitnessAddProofVctNil records vct witness.

func (*MetricsProvider) WitnessAddVC added in v0.1.3

func (m *MetricsProvider) WitnessAddVC(value time.Duration)

WitnessAddVC records vct witness add vc.

func (*MetricsProvider) WitnessAnchorCredentialTime added in v0.1.3

func (m *MetricsProvider) WitnessAnchorCredentialTime(value time.Duration)

WitnessAnchorCredentialTime records the time it takes for a verifiable credential to gather proofs from all required witnesses (according to witness policy). The start time is when the verifiable credential is issued and the end time is the time that the witness policy is satisfied.

func (*MetricsProvider) WitnessVerifyVCTSignature added in v0.1.3

func (m *MetricsProvider) WitnessVerifyVCTSignature(value time.Duration)

WitnessVerifyVCTSignature records vct witness verify vct.

func (*MetricsProvider) WitnessWebFinger added in v0.1.3

func (m *MetricsProvider) WitnessWebFinger(value time.Duration)

WitnessWebFinger records vct witness web finger.

func (*MetricsProvider) WriteAnchorBuildCredentialTime added in v0.1.3

func (m *MetricsProvider) WriteAnchorBuildCredentialTime(value time.Duration)

WriteAnchorBuildCredentialTime records the time it takes to build credential inside write anchor.

func (*MetricsProvider) WriteAnchorGetPreviousAnchorsGetBulkTime added in v0.1.3

func (m *MetricsProvider) WriteAnchorGetPreviousAnchorsGetBulkTime(value time.Duration)

WriteAnchorGetPreviousAnchorsGetBulkTime records the time it takes to get bulk inside previous anchor.

func (*MetricsProvider) WriteAnchorGetPreviousAnchorsTime added in v0.1.3

func (m *MetricsProvider) WriteAnchorGetPreviousAnchorsTime(value time.Duration)

WriteAnchorGetPreviousAnchorsTime records the time it takes to get previous anchor.

func (*MetricsProvider) WriteAnchorGetWitnessesTime added in v0.1.3

func (m *MetricsProvider) WriteAnchorGetWitnessesTime(value time.Duration)

WriteAnchorGetWitnessesTime records the time it takes to get witnesses inside write anchor.

func (*MetricsProvider) WriteAnchorPostOfferActivityTime added in v0.1.3

func (m *MetricsProvider) WriteAnchorPostOfferActivityTime(value time.Duration)

WriteAnchorPostOfferActivityTime records the time it takes to post offer activity inside write anchor.

func (*MetricsProvider) WriteAnchorResolveHostMetaLinkTime added in v0.1.3

func (m *MetricsProvider) WriteAnchorResolveHostMetaLinkTime(value time.Duration)

WriteAnchorResolveHostMetaLinkTime records the time it takes to resolve host meta link.

func (*MetricsProvider) WriteAnchorSignCredentialTime added in v0.1.3

func (m *MetricsProvider) WriteAnchorSignCredentialTime(value time.Duration)

WriteAnchorSignCredentialTime records the time it takes to sign credential inside write anchor.

func (*MetricsProvider) WriteAnchorSignLocalStoreTime added in v0.1.3

func (m *MetricsProvider) WriteAnchorSignLocalStoreTime(value time.Duration)

WriteAnchorSignLocalStoreTime records the time it takes to store inside sign local.

func (*MetricsProvider) WriteAnchorSignLocalWatchTime added in v0.1.3

func (m *MetricsProvider) WriteAnchorSignLocalWatchTime(value time.Duration)

WriteAnchorSignLocalWatchTime records the time it takes to watch inside sign local.

func (*MetricsProvider) WriteAnchorSignLocalWitnessLogTime added in v0.1.3

func (m *MetricsProvider) WriteAnchorSignLocalWitnessLogTime(value time.Duration)

WriteAnchorSignLocalWitnessLogTime records the time it takes to witness log inside sign local.

func (*MetricsProvider) WriteAnchorSignWithLocalWitnessTime added in v0.1.3

func (m *MetricsProvider) WriteAnchorSignWithLocalWitnessTime(value time.Duration)

WriteAnchorSignWithLocalWitnessTime records the time it takes to sign with local witness.

func (*MetricsProvider) WriteAnchorSignWithServerKeyTime added in v0.1.3

func (m *MetricsProvider) WriteAnchorSignWithServerKeyTime(value time.Duration)

WriteAnchorSignWithServerKeyTime records the time it takes to sign with server key.

func (*MetricsProvider) WriteAnchorTime added in v0.1.3

func (m *MetricsProvider) WriteAnchorTime(value time.Duration)

WriteAnchorTime records the time it takes to write an anchor credential and post an 'Offer' activity.

type MockOpStoreProvider

type MockOpStoreProvider struct {
	// contains filtered or unexported fields
}

MockOpStoreProvider is a mock operation store provider.

func NewMockOpStoreProvider

func NewMockOpStoreProvider(opStore observer.OperationStore) *MockOpStoreProvider

NewMockOpStoreProvider returns a new mock operation store provider.

func (*MockOpStoreProvider) ForNamespace

ForNamespace returns a mock operation store for the given namespace.

type MockOperationStore

type MockOperationStore struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

MockOperationStore is a mock operation store.

func NewMockOperationStore

func NewMockOperationStore() *MockOperationStore

NewMockOperationStore returns a new mock operation store.

func (*MockOperationStore) Get

Get retrieves the operations for the given suffix.

func (*MockOperationStore) Put

Put stores the given operations.

type MockProtocolClient

type MockProtocolClient struct {
	// contains filtered or unexported fields
}

MockProtocolClient mocks protocol for testing purposes.

func (*MockProtocolClient) Current

func (m *MockProtocolClient) Current() (protocol.Version, error)

Current mocks getting last protocol version.

func (*MockProtocolClient) Get

func (m *MockProtocolClient) Get(transactionTime uint64) (protocol.Version, error)

Get mocks getting protocol version based on blockchain(transaction) time.

type MockProtocolClientProvider

type MockProtocolClientProvider struct {
	// contains filtered or unexported fields
}

MockProtocolClientProvider implements mock protocol client provider.

func NewMockProtocolClientProvider

func NewMockProtocolClientProvider() *MockProtocolClientProvider

NewMockProtocolClientProvider creates new mock protocol client provider.

func (*MockProtocolClientProvider) ForNamespace

func (m *MockProtocolClientProvider) ForNamespace(namespace string) (protocol.Client, error)

ForNamespace will return protocol client for that namespace.

func (*MockProtocolClientProvider) WithAllowedOrigins

func (m *MockProtocolClientProvider) WithAllowedOrigins(origins []string) *MockProtocolClientProvider

WithAllowedOrigins allows for specifying allowed origins.

func (*MockProtocolClientProvider) WithAnchorGraph

WithAnchorGraph sets the anchor graph.

func (*MockProtocolClientProvider) WithBase

WithBase enables @base property during document transformation.

func (*MockProtocolClientProvider) WithCasClient

func (m *MockProtocolClientProvider) WithCasClient(casClient cas.Client) *MockProtocolClientProvider

WithCasClient sets the CAS client.

func (*MockProtocolClientProvider) WithMethodContext

func (m *MockProtocolClientProvider) WithMethodContext(ctx []string) *MockProtocolClientProvider

WithMethodContext sets method context for document transformer.

func (*MockProtocolClientProvider) WithOpStore

WithOpStore sets the operation store.

type PubSub added in v0.1.2

type PubSub struct {
	SubscribeStub func(ctx context.Context, topic string) (<-chan *message.Message, error)

	PublishStub func(topic string, messages ...*message.Message) error

	CloseStub func() error
	// contains filtered or unexported fields
}

func (*PubSub) Close added in v0.1.2

func (fake *PubSub) Close() error

func (*PubSub) CloseCallCount added in v0.1.2

func (fake *PubSub) CloseCallCount() int

func (*PubSub) CloseReturns added in v0.1.2

func (fake *PubSub) CloseReturns(result1 error)

func (*PubSub) CloseReturnsOnCall added in v0.1.2

func (fake *PubSub) CloseReturnsOnCall(i int, result1 error)

func (*PubSub) Invocations added in v0.1.2

func (fake *PubSub) Invocations() map[string][][]interface{}

func (*PubSub) Publish added in v0.1.2

func (fake *PubSub) Publish(topic string, messages ...*message.Message) error

func (*PubSub) PublishArgsForCall added in v0.1.2

func (fake *PubSub) PublishArgsForCall(i int) (string, []*message.Message)

func (*PubSub) PublishCallCount added in v0.1.2

func (fake *PubSub) PublishCallCount() int

func (*PubSub) PublishReturns added in v0.1.2

func (fake *PubSub) PublishReturns(result1 error)

func (*PubSub) PublishReturnsOnCall added in v0.1.2

func (fake *PubSub) PublishReturnsOnCall(i int, result1 error)

func (*PubSub) Subscribe added in v0.1.2

func (fake *PubSub) Subscribe(ctx context.Context, topic string) (<-chan *message.Message, error)

func (*PubSub) SubscribeArgsForCall added in v0.1.2

func (fake *PubSub) SubscribeArgsForCall(i int) (context.Context, string)

func (*PubSub) SubscribeCallCount added in v0.1.2

func (fake *PubSub) SubscribeCallCount() int

func (*PubSub) SubscribeReturns added in v0.1.2

func (fake *PubSub) SubscribeReturns(result1 <-chan *message.Message, result2 error)

func (*PubSub) SubscribeReturnsOnCall added in v0.1.2

func (fake *PubSub) SubscribeReturnsOnCall(i int, result1 <-chan *message.Message, result2 error)

Jump to

Keyboard shortcuts

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