mocks

package
v0.79.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package mocks is a generated GoMock package.

Package mocks is a generated GoMock package.

Package mocks is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockBroker

type MockBroker struct {
	// embed the broker mock here... this is how we can end up with a drop-in replacement
	*MockInterface
	// contains filtered or unexported fields
}

MockBroker - drop in mock that allows us to check the events themselves in unit tests (and as such ensure the state changes are correct) We're only overriding the Send and SendBatch functions. The way in which this is done shouldn't be a problem, even when using DoAndReturn, but you never know...

func NewMockBroker

func NewMockBroker(ctrl *gomock.Controller) *MockBroker

func (*MockBroker) GetAllByType

func (b *MockBroker) GetAllByType(t events.Type) []events.Event

GetAllByType returns all events of a given type the mock has received.

func (*MockBroker) GetLastByType

func (b *MockBroker) GetLastByType(t events.Type) events.Event

GetLastByType returns the most recent event for a given type. If SendBatch was called, this is the last event of the batch.

func (*MockBroker) GetLastByTypeAndID

func (b *MockBroker) GetLastByTypeAndID(t events.Type, id string) events.Event

GetLastByTypeAndID returns the last event of a given type, for a specific identified (party, market, order, etc...) list of implemented events - and ID's used:

  • Order (by order ID)
  • Account (by account ID)
  • Asset (by asset ID)
  • Auction (by market ID)
  • Deposit (party ID)
  • Proposal (proposal ID)
  • LP (by party ID)
  • MarginLevels (party ID)
  • MarketData (market ID)
  • PosRes (market ID)
  • RiskFactor (market ID)
  • SettleDistressed (party ID)
  • Vote (currently PartyID, might want to use proposalID, too?)
  • Withdrawal (PartyID)

func (*MockBroker) Send

func (b *MockBroker) Send(event events.Event)

Send - first call Send on the underlying mock, then add the argument to the various maps.

func (*MockBroker) SendBatch

func (b *MockBroker) SendBatch(evts []events.Event)

SendBatch - same as Send: call mock first, then add arguments to the maps.

type MockInterface added in v0.55.0

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

MockInterface is a mock of Interface interface.

func NewMockInterface added in v0.55.0

func NewMockInterface(ctrl *gomock.Controller) *MockInterface

NewMockInterface creates a new mock instance.

func (*MockInterface) EXPECT added in v0.55.0

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockInterface) Send added in v0.55.0

func (m *MockInterface) Send(arg0 events.Event)

Send mocks base method.

func (*MockInterface) SendBatch added in v0.55.0

func (m *MockInterface) SendBatch(arg0 []events.Event)

SendBatch mocks base method.

func (*MockInterface) SetStreaming added in v0.55.0

func (m *MockInterface) SetStreaming(arg0 bool) bool

SetStreaming mocks base method.

func (*MockInterface) Stage added in v0.74.2

func (m *MockInterface) Stage(arg0 events.Event)

Stage mocks base method.

func (*MockInterface) Subscribe added in v0.55.0

func (m *MockInterface) Subscribe(arg0 broker.Subscriber) int

Subscribe mocks base method.

func (*MockInterface) SubscribeBatch added in v0.55.0

func (m *MockInterface) SubscribeBatch(arg0 ...broker.Subscriber)

SubscribeBatch mocks base method.

func (*MockInterface) Unsubscribe added in v0.55.0

func (m *MockInterface) Unsubscribe(arg0 int)

Unsubscribe mocks base method.

type MockInterfaceMockRecorder added in v0.55.0

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

MockInterfaceMockRecorder is the mock recorder for MockInterface.

func (*MockInterfaceMockRecorder) Send added in v0.55.0

func (mr *MockInterfaceMockRecorder) Send(arg0 interface{}) *gomock.Call

Send indicates an expected call of Send.

func (*MockInterfaceMockRecorder) SendBatch added in v0.55.0

func (mr *MockInterfaceMockRecorder) SendBatch(arg0 interface{}) *gomock.Call

SendBatch indicates an expected call of SendBatch.

func (*MockInterfaceMockRecorder) SetStreaming added in v0.55.0

func (mr *MockInterfaceMockRecorder) SetStreaming(arg0 interface{}) *gomock.Call

SetStreaming indicates an expected call of SetStreaming.

func (*MockInterfaceMockRecorder) Stage added in v0.74.2

func (mr *MockInterfaceMockRecorder) Stage(arg0 interface{}) *gomock.Call

Stage indicates an expected call of Stage.

func (*MockInterfaceMockRecorder) Subscribe added in v0.55.0

func (mr *MockInterfaceMockRecorder) Subscribe(arg0 interface{}) *gomock.Call

Subscribe indicates an expected call of Subscribe.

func (*MockInterfaceMockRecorder) SubscribeBatch added in v0.55.0

func (mr *MockInterfaceMockRecorder) SubscribeBatch(arg0 ...interface{}) *gomock.Call

SubscribeBatch indicates an expected call of SubscribeBatch.

func (*MockInterfaceMockRecorder) Unsubscribe added in v0.55.0

func (mr *MockInterfaceMockRecorder) Unsubscribe(arg0 interface{}) *gomock.Call

Unsubscribe indicates an expected call of Unsubscribe.

type MockSocketClient

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

MockSocketClient is a mock of SocketClient interface.

func NewMockSocketClient

func NewMockSocketClient(ctrl *gomock.Controller) *MockSocketClient

NewMockSocketClient creates a new mock instance.

func (*MockSocketClient) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockSocketClient) Receive added in v0.65.0

func (m *MockSocketClient) Receive(arg0 context.Context) (<-chan events.Event, <-chan error)

Receive mocks base method.

func (*MockSocketClient) SendBatch

func (m *MockSocketClient) SendBatch(arg0 []events.Event) error

SendBatch mocks base method.

type MockSocketClientMockRecorder

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

MockSocketClientMockRecorder is the mock recorder for MockSocketClient.

func (*MockSocketClientMockRecorder) Receive added in v0.65.0

func (mr *MockSocketClientMockRecorder) Receive(arg0 interface{}) *gomock.Call

Receive indicates an expected call of Receive.

func (*MockSocketClientMockRecorder) SendBatch

func (mr *MockSocketClientMockRecorder) SendBatch(arg0 interface{}) *gomock.Call

SendBatch indicates an expected call of SendBatch.

type MockSubscriber

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

MockSubscriber is a mock of Subscriber interface.

func NewMockSubscriber

func NewMockSubscriber(ctrl *gomock.Controller) *MockSubscriber

NewMockSubscriber creates a new mock instance.

func (*MockSubscriber) Ack

func (m *MockSubscriber) Ack() bool

Ack mocks base method.

func (*MockSubscriber) C

func (m *MockSubscriber) C() chan<- []events.Event

C mocks base method.

func (*MockSubscriber) Closed

func (m *MockSubscriber) Closed() <-chan struct{}

Closed mocks base method.

func (*MockSubscriber) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockSubscriber) ID

func (m *MockSubscriber) ID() int

ID mocks base method.

func (*MockSubscriber) Push

func (m *MockSubscriber) Push(arg0 ...events.Event)

Push mocks base method.

func (*MockSubscriber) SetID

func (m *MockSubscriber) SetID(arg0 int)

SetID mocks base method.

func (*MockSubscriber) Skip

func (m *MockSubscriber) Skip() <-chan struct{}

Skip mocks base method.

func (*MockSubscriber) Types

func (m *MockSubscriber) Types() []events.Type

Types mocks base method.

type MockSubscriberMockRecorder

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

MockSubscriberMockRecorder is the mock recorder for MockSubscriber.

func (*MockSubscriberMockRecorder) Ack

Ack indicates an expected call of Ack.

func (*MockSubscriberMockRecorder) C

C indicates an expected call of C.

func (*MockSubscriberMockRecorder) Closed

func (mr *MockSubscriberMockRecorder) Closed() *gomock.Call

Closed indicates an expected call of Closed.

func (*MockSubscriberMockRecorder) ID

ID indicates an expected call of ID.

func (*MockSubscriberMockRecorder) Push

func (mr *MockSubscriberMockRecorder) Push(arg0 ...interface{}) *gomock.Call

Push indicates an expected call of Push.

func (*MockSubscriberMockRecorder) SetID

func (mr *MockSubscriberMockRecorder) SetID(arg0 interface{}) *gomock.Call

SetID indicates an expected call of SetID.

func (*MockSubscriberMockRecorder) Skip

Skip indicates an expected call of Skip.

func (*MockSubscriberMockRecorder) Types

func (mr *MockSubscriberMockRecorder) Types() *gomock.Call

Types indicates an expected call of Types.

Jump to

Keyboard shortcuts

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