Documentation ¶
Overview ¶
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
Index ¶
- type MockBroker
- func (b *MockBroker) GetAllByType(t events.Type) []events.Event
- func (b *MockBroker) GetLastByType(t events.Type) events.Event
- func (b *MockBroker) GetLastByTypeAndID(t events.Type, id string) events.Event
- func (b *MockBroker) Send(event events.Event)
- func (b *MockBroker) SendBatch(evts []events.Event)
- type MockInterface
- func (m *MockInterface) EXPECT() *MockInterfaceMockRecorder
- func (m *MockInterface) Send(arg0 events.Event)
- func (m *MockInterface) SendBatch(arg0 []events.Event)
- func (m *MockInterface) SetStreaming(arg0 bool) bool
- func (m *MockInterface) Subscribe(arg0 broker.Subscriber) int
- func (m *MockInterface) SubscribeBatch(arg0 ...broker.Subscriber)
- func (m *MockInterface) Unsubscribe(arg0 int)
- type MockInterfaceMockRecorder
- func (mr *MockInterfaceMockRecorder) Send(arg0 interface{}) *gomock.Call
- func (mr *MockInterfaceMockRecorder) SendBatch(arg0 interface{}) *gomock.Call
- func (mr *MockInterfaceMockRecorder) SetStreaming(arg0 interface{}) *gomock.Call
- func (mr *MockInterfaceMockRecorder) Subscribe(arg0 interface{}) *gomock.Call
- func (mr *MockInterfaceMockRecorder) SubscribeBatch(arg0 ...interface{}) *gomock.Call
- func (mr *MockInterfaceMockRecorder) Unsubscribe(arg0 interface{}) *gomock.Call
- type MockSocketClient
- type MockSocketClientMockRecorder
- type MockSubscriber
- func (m *MockSubscriber) Ack() bool
- func (m *MockSubscriber) C() chan<- []events.Event
- func (m *MockSubscriber) Closed() <-chan struct{}
- func (m *MockSubscriber) EXPECT() *MockSubscriberMockRecorder
- func (m *MockSubscriber) ID() int
- func (m *MockSubscriber) Push(arg0 ...events.Event)
- func (m *MockSubscriber) SetID(arg0 int)
- func (m *MockSubscriber) Skip() <-chan struct{}
- func (m *MockSubscriber) Types() []events.Type
- type MockSubscriberMockRecorder
- func (mr *MockSubscriberMockRecorder) Ack() *gomock.Call
- func (mr *MockSubscriberMockRecorder) C() *gomock.Call
- func (mr *MockSubscriberMockRecorder) Closed() *gomock.Call
- func (mr *MockSubscriberMockRecorder) ID() *gomock.Call
- func (mr *MockSubscriberMockRecorder) Push(arg0 ...interface{}) *gomock.Call
- func (mr *MockSubscriberMockRecorder) SetID(arg0 interface{}) *gomock.Call
- func (mr *MockSubscriberMockRecorder) Skip() *gomock.Call
- func (mr *MockSubscriberMockRecorder) Types() *gomock.Call
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 ¶
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
func (m *MockInterface) EXPECT() *MockInterfaceMockRecorder
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) 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) 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 ¶
func (m *MockSocketClient) EXPECT() *MockSocketClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockSocketClientMockRecorder ¶
type MockSocketClientMockRecorder struct {
// contains filtered or unexported fields
}
MockSocketClientMockRecorder is the mock recorder for MockSocketClient.
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) Closed ¶
func (m *MockSubscriber) Closed() <-chan struct{}
Closed mocks base method.
func (*MockSubscriber) EXPECT ¶
func (m *MockSubscriber) EXPECT() *MockSubscriberMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockSubscriber) Push ¶
func (m *MockSubscriber) Push(arg0 ...events.Event)
Push 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 ¶
func (mr *MockSubscriberMockRecorder) Ack() *gomock.Call
Ack indicates an expected call of Ack.
func (*MockSubscriberMockRecorder) C ¶
func (mr *MockSubscriberMockRecorder) C() *gomock.Call
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 ¶
func (mr *MockSubscriberMockRecorder) ID() *gomock.Call
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 ¶
func (mr *MockSubscriberMockRecorder) Skip() *gomock.Call
Skip indicates an expected call of Skip.
func (*MockSubscriberMockRecorder) Types ¶
func (mr *MockSubscriberMockRecorder) Types() *gomock.Call
Types indicates an expected call of Types.