mocks

package
v0.0.0-...-365054f Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Quality

func Quality() market.Quality

Quality is the default quality for test proposals.

Types

type EventBus

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

EventBus is a fake event bus.

func NewEventBus

func NewEventBus() *EventBus

NewEventBus creates a new fake event bus.

func (*EventBus) Clear

func (mp *EventBus) Clear()

Clear clears the event history

func (*EventBus) GetEventHistory

func (mp *EventBus) GetEventHistory() []EventBusEntry

GetEventHistory fetches the event history

func (*EventBus) Pop

func (mp *EventBus) Pop() interface{}

Pop pops the last event for assertions.

func (*EventBus) Publish

func (mp *EventBus) Publish(topic string, event interface{})

Publish fakes publish.

func (*EventBus) Subscribe

func (mp *EventBus) Subscribe(topic string, fn interface{}) error

Subscribe fakes subscribe.

func (*EventBus) SubscribeAsync

func (mp *EventBus) SubscribeAsync(topic string, fn interface{}) error

SubscribeAsync fakes async subsribe.

func (*EventBus) SubscribeWithUID

func (mp *EventBus) SubscribeWithUID(topic, uid string, fn interface{}) error

SubscribeWithUID fakes subscribe.

func (*EventBus) Unsubscribe

func (mp *EventBus) Unsubscribe(topic string, fn interface{}) error

Unsubscribe fakes unsubscribe.

func (*EventBus) UnsubscribeWithUID

func (mp *EventBus) UnsubscribeWithUID(topic, uid string, fn interface{}) error

UnsubscribeWithUID fakes unsubscribe.

type EventBusEntry

type EventBusEntry struct {
	Topic string
	Event interface{}
}

EventBusEntry represents the entry in publisher's history

type IdentityProvider

type IdentityProvider struct {
	Identities []identity.Identity
	// contains filtered or unexported fields
}

IdentityProvider is a fake identity provider.

func (*IdentityProvider) GetIdentities

func (ip *IdentityProvider) GetIdentities() []identity.Identity

GetIdentities returns a predefined set of identities.

type IdentityRegistry

type IdentityRegistry struct {
	Status registry.RegistrationStatus
}

IdentityRegistry is a fake identity registry.

func (IdentityRegistry) GetRegistrationStatus

func (i IdentityRegistry) GetRegistrationStatus(_ int64, _ identity.Identity) (registry.RegistrationStatus, error)

GetRegistrationStatus returns a pre-defined RegistrationStatus.

func (IdentityRegistry) Subscribe

func (i IdentityRegistry) Subscribe(_ eventbus.Subscriber) error

Subscribe does nothing.

Jump to

Keyboard shortcuts

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