mocks

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Code generated by counterfeiter. DO NOT EDIT.

Code generated by counterfeiter. DO NOT EDIT.

Code generated by counterfeiter. DO NOT EDIT.

Code generated by counterfeiter. DO NOT EDIT.

Code generated by counterfeiter. DO NOT EDIT.

Code generated by counterfeiter. DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AcceptFollowHandler

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

AcceptFollowHandler implements a mock accept follow handler.

func NewAcceptFollowHandler

func NewAcceptFollowHandler() *AcceptFollowHandler

NewAcceptFollowHandler returns a mock accept follow handler.

func (*AcceptFollowHandler) Accept

func (m *AcceptFollowHandler) Accept(actor *url.URL) error

Accept accepts/rejects follow request.

func (*AcceptFollowHandler) WithError

func (m *AcceptFollowHandler) WithError(err error) *AcceptFollowHandler

WithError injects an error.

type AcceptListMgr

type AcceptListMgr struct {
	GetStub func(target string) ([]*url.URL, error)
	// contains filtered or unexported fields
}

func (*AcceptListMgr) Get

func (fake *AcceptListMgr) Get(target string) ([]*url.URL, error)

func (*AcceptListMgr) GetArgsForCall

func (fake *AcceptListMgr) GetArgsForCall(i int) string

func (*AcceptListMgr) GetCallCount

func (fake *AcceptListMgr) GetCallCount() int

func (*AcceptListMgr) GetReturns

func (fake *AcceptListMgr) GetReturns(result1 []*url.URL, result2 error)

func (*AcceptListMgr) GetReturnsOnCall

func (fake *AcceptListMgr) GetReturnsOnCall(i int, result1 []*url.URL, result2 error)

func (*AcceptListMgr) Invocations

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

type Activities

type Activities []*vocab.ActivityType

Activities contains a slice of ActivityType.

func (Activities) QueryByType

func (a Activities) QueryByType(types ...vocab.Type) Activities

QueryByType returns the activities that match the given types.

type ActivityHandler

type ActivityHandler struct {
	HandleActivityStub func(*url.URL, *vocab.ActivityType) error

	StartStub func()

	StateStub func() uint32

	StopStub func()

	SubscribeStub func() <-chan *vocab.ActivityType
	// contains filtered or unexported fields
}

func (*ActivityHandler) HandleActivity

func (fake *ActivityHandler) HandleActivity(arg1 *url.URL, arg2 *vocab.ActivityType) error

func (*ActivityHandler) HandleActivityArgsForCall

func (fake *ActivityHandler) HandleActivityArgsForCall(i int) (*url.URL, *vocab.ActivityType)

func (*ActivityHandler) HandleActivityCallCount

func (fake *ActivityHandler) HandleActivityCallCount() int

func (*ActivityHandler) HandleActivityCalls

func (fake *ActivityHandler) HandleActivityCalls(stub func(*url.URL, *vocab.ActivityType) error)

func (*ActivityHandler) HandleActivityReturns

func (fake *ActivityHandler) HandleActivityReturns(result1 error)

func (*ActivityHandler) HandleActivityReturnsOnCall

func (fake *ActivityHandler) HandleActivityReturnsOnCall(i int, result1 error)

func (*ActivityHandler) Invocations

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

func (*ActivityHandler) Start

func (fake *ActivityHandler) Start()

func (*ActivityHandler) StartCallCount

func (fake *ActivityHandler) StartCallCount() int

func (*ActivityHandler) StartCalls

func (fake *ActivityHandler) StartCalls(stub func())

func (*ActivityHandler) State

func (fake *ActivityHandler) State() uint32

func (*ActivityHandler) StateCallCount

func (fake *ActivityHandler) StateCallCount() int

func (*ActivityHandler) StateCalls

func (fake *ActivityHandler) StateCalls(stub func() uint32)

func (*ActivityHandler) StateReturns

func (fake *ActivityHandler) StateReturns(result1 uint32)

func (*ActivityHandler) StateReturnsOnCall

func (fake *ActivityHandler) StateReturnsOnCall(i int, result1 uint32)

func (*ActivityHandler) Stop

func (fake *ActivityHandler) Stop()

func (*ActivityHandler) StopCallCount

func (fake *ActivityHandler) StopCallCount() int

func (*ActivityHandler) StopCalls

func (fake *ActivityHandler) StopCalls(stub func())

func (*ActivityHandler) Subscribe

func (fake *ActivityHandler) Subscribe() <-chan *vocab.ActivityType

func (*ActivityHandler) SubscribeCallCount

func (fake *ActivityHandler) SubscribeCallCount() int

func (*ActivityHandler) SubscribeCalls

func (fake *ActivityHandler) SubscribeCalls(stub func() <-chan *vocab.ActivityType)

func (*ActivityHandler) SubscribeReturns

func (fake *ActivityHandler) SubscribeReturns(result1 <-chan *vocab.ActivityType)

func (*ActivityHandler) SubscribeReturnsOnCall

func (fake *ActivityHandler) SubscribeReturnsOnCall(i int, result1 <-chan *vocab.ActivityType)

type ActivityIterator

type ActivityIterator struct {
	NextStub func() (*vocab.ActivityType, error)

	NextPageStub func() (*url.URL, error)

	SetNextIndexStub func(int)

	TotalItemsStub func() int

	CurrentPageStub func() *url.URL

	NextIndexStub func() int
	// contains filtered or unexported fields
}

func (*ActivityIterator) CurrentPage

func (fake *ActivityIterator) CurrentPage() *url.URL

func (*ActivityIterator) CurrentPageCallCount

func (fake *ActivityIterator) CurrentPageCallCount() int

func (*ActivityIterator) CurrentPageReturns

func (fake *ActivityIterator) CurrentPageReturns(result1 *url.URL)

func (*ActivityIterator) CurrentPageReturnsOnCall

func (fake *ActivityIterator) CurrentPageReturnsOnCall(i int, result1 *url.URL)

func (*ActivityIterator) Invocations

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

func (*ActivityIterator) Next

func (fake *ActivityIterator) Next() (*vocab.ActivityType, error)

func (*ActivityIterator) NextCallCount

func (fake *ActivityIterator) NextCallCount() int

func (*ActivityIterator) NextIndex

func (fake *ActivityIterator) NextIndex() int

func (*ActivityIterator) NextIndexCallCount

func (fake *ActivityIterator) NextIndexCallCount() int

func (*ActivityIterator) NextIndexReturns

func (fake *ActivityIterator) NextIndexReturns(result1 int)

func (*ActivityIterator) NextIndexReturnsOnCall

func (fake *ActivityIterator) NextIndexReturnsOnCall(i int, result1 int)

func (*ActivityIterator) NextPage

func (fake *ActivityIterator) NextPage() (*url.URL, error)

func (*ActivityIterator) NextPageCallCount

func (fake *ActivityIterator) NextPageCallCount() int

func (*ActivityIterator) NextPageReturns

func (fake *ActivityIterator) NextPageReturns(result1 *url.URL, result2 error)

func (*ActivityIterator) NextPageReturnsOnCall

func (fake *ActivityIterator) NextPageReturnsOnCall(i int, result1 *url.URL, result2 error)

func (*ActivityIterator) NextReturns

func (fake *ActivityIterator) NextReturns(result1 *vocab.ActivityType, result2 error)

func (*ActivityIterator) NextReturnsOnCall

func (fake *ActivityIterator) NextReturnsOnCall(i int, result1 *vocab.ActivityType, result2 error)

func (*ActivityIterator) SetNextIndex

func (fake *ActivityIterator) SetNextIndex(arg1 int)

func (*ActivityIterator) SetNextIndexArgsForCall

func (fake *ActivityIterator) SetNextIndexArgsForCall(i int) int

func (*ActivityIterator) SetNextIndexCallCount

func (fake *ActivityIterator) SetNextIndexCallCount() int

func (*ActivityIterator) TotalItems

func (fake *ActivityIterator) TotalItems() int

func (*ActivityIterator) TotalItemsCallCount

func (fake *ActivityIterator) TotalItemsCallCount() int

func (*ActivityIterator) TotalItemsReturns

func (fake *ActivityIterator) TotalItemsReturns(result1 int)

func (*ActivityIterator) TotalItemsReturnsOnCall

func (fake *ActivityIterator) TotalItemsReturnsOnCall(i int, result1 int)

type ActivityPubClient

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

ActivityPubClient is a mock ActivityPub client.

func NewActivitPubClient

func NewActivitPubClient() *ActivityPubClient

NewActivitPubClient returns a mock ActivityPub client.

func (*ActivityPubClient) GetActivities

func (m *ActivityPubClient) GetActivities(iri *url.URL, _ client.Order) (client.ActivityIterator, error)

GetActivities simply returns an iterator that contains the mock activities.

func (*ActivityPubClient) GetActor

func (m *ActivityPubClient) GetActor(actorIRI *url.URL) (*vocab.ActorType, error)

GetActor returns the actor for the given IRI.

func (*ActivityPubClient) GetPublicKey

func (m *ActivityPubClient) GetPublicKey(keyIRI *url.URL) (*vocab.PublicKeyType, error)

GetPublicKey returns the public key for the given IRI.

func (*ActivityPubClient) GetReferences

func (m *ActivityPubClient) GetReferences(iri *url.URL) (client.ReferenceIterator, error)

GetReferences simply returns an iterator that contains the IRI passed as an arg.

func (*ActivityPubClient) WithActivities

func (m *ActivityPubClient) WithActivities(activities []*vocab.ActivityType) *ActivityPubClient

WithActivities sets the given activities to the slice of activities which is used by GetActivities.

func (*ActivityPubClient) WithActor

func (m *ActivityPubClient) WithActor(actor *vocab.ActorType) *ActivityPubClient

WithActor adds the given actor to the map of actors which is used by GetActor.

func (*ActivityPubClient) WithError

func (m *ActivityPubClient) WithError(err error) *ActivityPubClient

WithError sets an error to be returned when any function is invoked on this struct.

func (*ActivityPubClient) WithPublicKey

func (m *ActivityPubClient) WithPublicKey(key *vocab.PublicKeyType) *ActivityPubClient

WithPublicKey adds the given public key to the map of keys which is used by GetPublicKey.

type ActivityStore

type ActivityStore struct {
	AddActivityStub func(*vocab.ActivityType) error

	AddReferenceStub func(spi.ReferenceType, *url.URL, *url.URL, ...spi.RefMetadataOpt) error

	DeleteReferenceStub func(spi.ReferenceType, *url.URL, *url.URL) error

	GetActivityStub func(*url.URL) (*vocab.ActivityType, error)

	GetActorStub func(*url.URL) (*vocab.ActorType, error)

	PutActorStub func(*vocab.ActorType) error

	QueryActivitiesStub func(*spi.Criteria, ...spi.QueryOpt) (spi.ActivityIterator, error)

	QueryReferencesStub func(spi.ReferenceType, *spi.Criteria, ...spi.QueryOpt) (spi.ReferenceIterator, error)
	// contains filtered or unexported fields
}

func (*ActivityStore) AddActivity

func (fake *ActivityStore) AddActivity(arg1 *vocab.ActivityType) error

func (*ActivityStore) AddActivityArgsForCall

func (fake *ActivityStore) AddActivityArgsForCall(i int) *vocab.ActivityType

func (*ActivityStore) AddActivityCallCount

func (fake *ActivityStore) AddActivityCallCount() int

func (*ActivityStore) AddActivityCalls

func (fake *ActivityStore) AddActivityCalls(stub func(*vocab.ActivityType) error)

func (*ActivityStore) AddActivityReturns

func (fake *ActivityStore) AddActivityReturns(result1 error)

func (*ActivityStore) AddActivityReturnsOnCall

func (fake *ActivityStore) AddActivityReturnsOnCall(i int, result1 error)

func (*ActivityStore) AddReference

func (fake *ActivityStore) AddReference(arg1 spi.ReferenceType, arg2 *url.URL, arg3 *url.URL, arg4 ...spi.RefMetadataOpt) error

func (*ActivityStore) AddReferenceArgsForCall

func (fake *ActivityStore) AddReferenceArgsForCall(i int) (spi.ReferenceType, *url.URL, *url.URL, []spi.RefMetadataOpt)

func (*ActivityStore) AddReferenceCallCount

func (fake *ActivityStore) AddReferenceCallCount() int

func (*ActivityStore) AddReferenceCalls

func (fake *ActivityStore) AddReferenceCalls(stub func(spi.ReferenceType, *url.URL, *url.URL, ...spi.RefMetadataOpt) error)

func (*ActivityStore) AddReferenceReturns

func (fake *ActivityStore) AddReferenceReturns(result1 error)

func (*ActivityStore) AddReferenceReturnsOnCall

func (fake *ActivityStore) AddReferenceReturnsOnCall(i int, result1 error)

func (*ActivityStore) DeleteReference

func (fake *ActivityStore) DeleteReference(arg1 spi.ReferenceType, arg2 *url.URL, arg3 *url.URL) error

func (*ActivityStore) DeleteReferenceArgsForCall

func (fake *ActivityStore) DeleteReferenceArgsForCall(i int) (spi.ReferenceType, *url.URL, *url.URL)

func (*ActivityStore) DeleteReferenceCallCount

func (fake *ActivityStore) DeleteReferenceCallCount() int

func (*ActivityStore) DeleteReferenceCalls

func (fake *ActivityStore) DeleteReferenceCalls(stub func(spi.ReferenceType, *url.URL, *url.URL) error)

func (*ActivityStore) DeleteReferenceReturns

func (fake *ActivityStore) DeleteReferenceReturns(result1 error)

func (*ActivityStore) DeleteReferenceReturnsOnCall

func (fake *ActivityStore) DeleteReferenceReturnsOnCall(i int, result1 error)

func (*ActivityStore) GetActivity

func (fake *ActivityStore) GetActivity(arg1 *url.URL) (*vocab.ActivityType, error)

func (*ActivityStore) GetActivityArgsForCall

func (fake *ActivityStore) GetActivityArgsForCall(i int) *url.URL

func (*ActivityStore) GetActivityCallCount

func (fake *ActivityStore) GetActivityCallCount() int

func (*ActivityStore) GetActivityCalls

func (fake *ActivityStore) GetActivityCalls(stub func(*url.URL) (*vocab.ActivityType, error))

func (*ActivityStore) GetActivityReturns

func (fake *ActivityStore) GetActivityReturns(result1 *vocab.ActivityType, result2 error)

func (*ActivityStore) GetActivityReturnsOnCall

func (fake *ActivityStore) GetActivityReturnsOnCall(i int, result1 *vocab.ActivityType, result2 error)

func (*ActivityStore) GetActor

func (fake *ActivityStore) GetActor(arg1 *url.URL) (*vocab.ActorType, error)

func (*ActivityStore) GetActorArgsForCall

func (fake *ActivityStore) GetActorArgsForCall(i int) *url.URL

func (*ActivityStore) GetActorCallCount

func (fake *ActivityStore) GetActorCallCount() int

func (*ActivityStore) GetActorCalls

func (fake *ActivityStore) GetActorCalls(stub func(*url.URL) (*vocab.ActorType, error))

func (*ActivityStore) GetActorReturns

func (fake *ActivityStore) GetActorReturns(result1 *vocab.ActorType, result2 error)

func (*ActivityStore) GetActorReturnsOnCall

func (fake *ActivityStore) GetActorReturnsOnCall(i int, result1 *vocab.ActorType, result2 error)

func (*ActivityStore) Invocations

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

func (*ActivityStore) PutActor

func (fake *ActivityStore) PutActor(arg1 *vocab.ActorType) error

func (*ActivityStore) PutActorArgsForCall

func (fake *ActivityStore) PutActorArgsForCall(i int) *vocab.ActorType

func (*ActivityStore) PutActorCallCount

func (fake *ActivityStore) PutActorCallCount() int

func (*ActivityStore) PutActorCalls

func (fake *ActivityStore) PutActorCalls(stub func(*vocab.ActorType) error)

func (*ActivityStore) PutActorReturns

func (fake *ActivityStore) PutActorReturns(result1 error)

func (*ActivityStore) PutActorReturnsOnCall

func (fake *ActivityStore) PutActorReturnsOnCall(i int, result1 error)

func (*ActivityStore) QueryActivities

func (fake *ActivityStore) QueryActivities(arg1 *spi.Criteria, arg2 ...spi.QueryOpt) (spi.ActivityIterator, error)

func (*ActivityStore) QueryActivitiesArgsForCall

func (fake *ActivityStore) QueryActivitiesArgsForCall(i int) (*spi.Criteria, []spi.QueryOpt)

func (*ActivityStore) QueryActivitiesCallCount

func (fake *ActivityStore) QueryActivitiesCallCount() int

func (*ActivityStore) QueryActivitiesCalls

func (fake *ActivityStore) QueryActivitiesCalls(stub func(*spi.Criteria, ...spi.QueryOpt) (spi.ActivityIterator, error))

func (*ActivityStore) QueryActivitiesReturns

func (fake *ActivityStore) QueryActivitiesReturns(result1 spi.ActivityIterator, result2 error)

func (*ActivityStore) QueryActivitiesReturnsOnCall

func (fake *ActivityStore) QueryActivitiesReturnsOnCall(i int, result1 spi.ActivityIterator, result2 error)

func (*ActivityStore) QueryReferences

func (fake *ActivityStore) QueryReferences(arg1 spi.ReferenceType, arg2 *spi.Criteria, arg3 ...spi.QueryOpt) (spi.ReferenceIterator, error)

func (*ActivityStore) QueryReferencesArgsForCall

func (fake *ActivityStore) QueryReferencesArgsForCall(i int) (spi.ReferenceType, *spi.Criteria, []spi.QueryOpt)

func (*ActivityStore) QueryReferencesCallCount

func (fake *ActivityStore) QueryReferencesCallCount() int

func (*ActivityStore) QueryReferencesCalls

func (fake *ActivityStore) QueryReferencesCalls(stub func(spi.ReferenceType, *spi.Criteria, ...spi.QueryOpt) (spi.ReferenceIterator, error))

func (*ActivityStore) QueryReferencesReturns

func (fake *ActivityStore) QueryReferencesReturns(result1 spi.ReferenceIterator, result2 error)

func (*ActivityStore) QueryReferencesReturnsOnCall

func (fake *ActivityStore) QueryReferencesReturnsOnCall(i int, result1 spi.ReferenceIterator, result2 error)

type ActorAuth

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

ActorAuth implements a mock actor authorization handler.

func NewActorAuth

func NewActorAuth() *ActorAuth

NewActorAuth returns a mock actor authorization.

func (*ActorAuth) AuthorizeActor

func (m *ActorAuth) AuthorizeActor(follower *vocab.ActorType) (bool, error)

AuthorizeActor is a mock implementation that returns the injected values.

func (*ActorAuth) WithAccept

func (m *ActorAuth) WithAccept() *ActorAuth

WithAccept ensures that the request is accepted.

func (*ActorAuth) WithError

func (m *ActorAuth) WithError(err error) *ActorAuth

WithError injects an error into the handler.

func (*ActorAuth) WithReject

func (m *ActorAuth) WithReject() *ActorAuth

WithReject ensures that the request is rejected.

type AnchorEventAcknowledgementHandler

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

AnchorEventAcknowledgementHandler implements a mock anchor event acknowledgement handler.

func NewAnchorEventAcknowledgementHandler

func NewAnchorEventAcknowledgementHandler() *AnchorEventAcknowledgementHandler

NewAnchorEventAcknowledgementHandler returns a mock handler.

func (*AnchorEventAcknowledgementHandler) AnchorEventAcknowledged

func (m *AnchorEventAcknowledgementHandler) AnchorEventAcknowledged(actor, anchorRef *url.URL,
	additionalAnchorRefs []*url.URL) error

AnchorEventAcknowledged handles the acknowledgement of a successful anchor event processed from an Oak server.

func (*AnchorEventAcknowledgementHandler) Anchors

func (m *AnchorEventAcknowledgementHandler) Anchors() []*url.URL

Anchors returns the anchors that were added to this mock.

func (*AnchorEventAcknowledgementHandler) UndoAnchorEventAcknowledgement

func (m *AnchorEventAcknowledgementHandler) UndoAnchorEventAcknowledgement(actor, anchorRef *url.URL,
	additionalAnchorRefs []*url.URL) error

UndoAnchorEventAcknowledgement undoes the acknowledgement of an anchor event processed from an Oak server.

func (*AnchorEventAcknowledgementHandler) WithError

WithError injects an error.

type AnchorEventHandler

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

AnchorEventHandler is a mock anchor event handler.

func NewAnchorEventHandler

func NewAnchorEventHandler() *AnchorEventHandler

NewAnchorEventHandler returns a mock anchor event handler.

func (*AnchorEventHandler) AnchorEvent

func (m *AnchorEventHandler) AnchorEvent(hl string) (*vocab.AnchorEventType, bool)

AnchorEvent returns the anchor credential by ID or nil if it doesn't exist.

func (*AnchorEventHandler) HandleAnchorEvent

func (m *AnchorEventHandler) HandleAnchorEvent(actor, hl, src *url.URL, anchorEvent *vocab.AnchorEventType) error

HandleAnchorEvent stores the anchor event or returns an error if it was set.

func (*AnchorEventHandler) WithError

func (m *AnchorEventHandler) WithError(err error) *AnchorEventHandler

WithError injects an error into the mock handler.

type MockPubSub

type MockPubSub struct {
	*lifecycle.Lifecycle

	Err     error
	MsgChan map[string]chan *message.Message

	Timeout time.Duration
	// contains filtered or unexported fields
}

MockPubSub implements a mock publisher-subscriber.

func NewPubSub

func NewPubSub() *MockPubSub

NewPubSub returns a mock publisher-subscriber.

func (*MockPubSub) Close

func (m *MockPubSub) Close() error

Close closes the subscriber channels.

func (*MockPubSub) Publish

func (m *MockPubSub) Publish(topic string, messages ...*message.Message) error

Publish publishes the messages to the subscribers.

func (*MockPubSub) Subscribe

func (m *MockPubSub) Subscribe(_ context.Context, topic string) (<-chan *message.Message, error)

Subscribe subscribes to the given topic.

func (*MockPubSub) SubscribeWithOpts

func (m *MockPubSub) SubscribeWithOpts(ctx context.Context,
	topic string, _ ...spi.Option) (<-chan *message.Message, error)

SubscribeWithOpts subscribes to the given topic.

func (*MockPubSub) WithError

func (m *MockPubSub) WithError(err error) *MockPubSub

WithError injects an error into the mock publisher-subscriber.

type Outbox

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

Outbox implements a mock Outbox.

func NewOutbox

func NewOutbox() *Outbox

NewOutbox returns a mock outbox.

func (*Outbox) Activities

func (m *Outbox) Activities() Activities

Activities returns the activities that were posted to the outbox.

func (*Outbox) Post

func (m *Outbox) Post(activity *vocab.ActivityType, _ ...*url.URL) (*url.URL, error)

Post post an activity to the outbox. The activity is simply stored so that it may be retrieved by the Activies function.

func (*Outbox) Start

func (m *Outbox) Start()

Start does nothing.

func (*Outbox) State

func (m *Outbox) State() lifecycle.State

State always returns StateStarted.

func (*Outbox) Stop

func (m *Outbox) Stop()

Stop does nothing.

func (*Outbox) WithActivityID

func (m *Outbox) WithActivityID(id *url.URL) *Outbox

WithActivityID sets the ID of the posted activity.

func (*Outbox) WithError

func (m *Outbox) WithError(err error) *Outbox

WithError injects an error into the mock outbox.

type ProofHandler

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

ProofHandler implements a mock proof handler.

func NewProofHandler

func NewProofHandler() *ProofHandler

NewProofHandler returns a mock proof handler.

func (*ProofHandler) HandleProof

func (m *ProofHandler) HandleProof(witness *url.URL, anchorCredID string, endTime time.Time, proof []byte) error

HandleProof store the proof and returns any injected error.

func (*ProofHandler) Proof

func (m *ProofHandler) Proof(objID string) []byte

Proof returns the stored proof for the givin ID.

func (*ProofHandler) WithError

func (m *ProofHandler) WithError(err error) *ProofHandler

WithError injects an error.

type ReferenceIterator

type ReferenceIterator struct {
	NextStub func() (*url.URL, error)

	TotalItemsStub func() int
	// contains filtered or unexported fields
}

func (*ReferenceIterator) Invocations

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

func (*ReferenceIterator) Next

func (fake *ReferenceIterator) Next() (*url.URL, error)

func (*ReferenceIterator) NextCallCount

func (fake *ReferenceIterator) NextCallCount() int

func (*ReferenceIterator) NextReturns

func (fake *ReferenceIterator) NextReturns(result1 *url.URL, result2 error)

func (*ReferenceIterator) NextReturnsOnCall

func (fake *ReferenceIterator) NextReturnsOnCall(i int, result1 *url.URL, result2 error)

func (*ReferenceIterator) TotalItems

func (fake *ReferenceIterator) TotalItems() int

func (*ReferenceIterator) TotalItemsCallCount

func (fake *ReferenceIterator) TotalItemsCallCount() int

func (*ReferenceIterator) TotalItemsReturns

func (fake *ReferenceIterator) TotalItemsReturns(result1 int)

func (*ReferenceIterator) TotalItemsReturnsOnCall

func (fake *ReferenceIterator) TotalItemsReturnsOnCall(i int, result1 int)

type SignatureVerifier

type SignatureVerifier struct {
	VerifyRequestStub func(req *http.Request) (bool, *url.URL, error)
	// contains filtered or unexported fields
}

func (*SignatureVerifier) Invocations

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

func (*SignatureVerifier) VerifyRequest

func (fake *SignatureVerifier) VerifyRequest(req *http.Request) (bool, *url.URL, error)

func (*SignatureVerifier) VerifyRequestArgsForCall

func (fake *SignatureVerifier) VerifyRequestArgsForCall(i int) *http.Request

func (*SignatureVerifier) VerifyRequestCallCount

func (fake *SignatureVerifier) VerifyRequestCallCount() int

func (*SignatureVerifier) VerifyRequestReturns

func (fake *SignatureVerifier) VerifyRequestReturns(result1 bool, result2 *url.URL, result3 error)

func (*SignatureVerifier) VerifyRequestReturnsOnCall

func (fake *SignatureVerifier) VerifyRequestReturnsOnCall(i int, result1 bool, result2 *url.URL, result3 error)

type Subscriber

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

Subscriber implements a mock activity subscriber.

func NewSubscriber

func NewSubscriber(activityChan <-chan *vocab.ActivityType) *Subscriber

NewSubscriber returns a new mock activity subscriber.

func (*Subscriber) Activities

func (m *Subscriber) Activities() []*vocab.ActivityType

Activities returns the activities that were received by the subscriber.

type TaskManager

type TaskManager struct {
	*lifecycle.Lifecycle
	// contains filtered or unexported fields
}

TaskManager is a mock implementation of a task manager.

func NewTaskManager

func NewTaskManager(instanceID string) *TaskManager

NewTaskManager returns a new mock task manager.

func (*TaskManager) InstanceID

func (m *TaskManager) InstanceID() string

InstanceID returns the server instance ID.

func (*TaskManager) RegisterTask

func (m *TaskManager) RegisterTask(_ string, interval time.Duration, run func())

RegisterTask registers the given task to be run at the given interval.

func (*TaskManager) WithInterval

func (m *TaskManager) WithInterval(interval time.Duration) *TaskManager

WithInterval sets the check interval.

type UndoFollowHandler

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

UndoFollowHandler implements a mock undo follow handler.

func NewUndoFollowHandler

func NewUndoFollowHandler() *UndoFollowHandler

NewUndoFollowHandler returns a mock undo follow handler.

func (*UndoFollowHandler) Undo

func (m *UndoFollowHandler) Undo(actor *url.URL) error

Undo removes follow request.

func (*UndoFollowHandler) WithError

func (m *UndoFollowHandler) WithError(err error) *UndoFollowHandler

WithError injects an error.

type WebFingerResolver

type WebFingerResolver struct {
	Err error
	URI string
}

WebFingerResolver implements a mock WebFinger resolver.

func (m *WebFingerResolver) ResolveHostMetaLink(uri, _ string) (string, error)

ResolveHostMetaLink returns either the specified error, the specified URI, otherwise, if neither were specified then the URI in the argument is returned.

type WitnessHandler

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

WitnessHandler implements a mock witness handler.

func NewWitnessHandler

func NewWitnessHandler() *WitnessHandler

NewWitnessHandler returns a mock witness handler.

func (*WitnessHandler) AnchorCreds

func (m *WitnessHandler) AnchorCreds() [][]byte

AnchorCreds returns all of the anchor credentials that were witnessed by this mock.

func (*WitnessHandler) WithError

func (m *WitnessHandler) WithError(err error) *WitnessHandler

WithError injects an error.

func (*WitnessHandler) WithProof

func (m *WitnessHandler) WithProof(proof []byte) *WitnessHandler

WithProof sets the proof to be returned from the witness handler.

func (*WitnessHandler) Witness

func (m *WitnessHandler) Witness(anchorCred []byte) ([]byte, error)

Witness adds the anchor credential to a list that can be inspected using the AnchorCreds function and returns the injected proof/error.

Jump to

Keyboard shortcuts

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