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 MockBrokerI
- func (m *MockBrokerI) EXPECT() *MockBrokerIMockRecorder
- func (m *MockBrokerI) Send(arg0 events.Event)
- func (m *MockBrokerI) SendBatch(arg0 []events.Event)
- func (m *MockBrokerI) SetStreaming(arg0 bool) bool
- func (m *MockBrokerI) Subscribe(arg0 broker.Subscriber) int
- func (m *MockBrokerI) SubscribeBatch(arg0 ...broker.Subscriber)
- func (m *MockBrokerI) Unsubscribe(arg0 int)
- type MockBrokerIMockRecorder
- func (mr *MockBrokerIMockRecorder) Send(arg0 interface{}) *gomock.Call
- func (mr *MockBrokerIMockRecorder) SendBatch(arg0 interface{}) *gomock.Call
- func (mr *MockBrokerIMockRecorder) SetStreaming(arg0 interface{}) *gomock.Call
- func (mr *MockBrokerIMockRecorder) Subscribe(arg0 interface{}) *gomock.Call
- func (mr *MockBrokerIMockRecorder) SubscribeBatch(arg0 ...interface{}) *gomock.Call
- func (mr *MockBrokerIMockRecorder) 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 *MockBrokerI // 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 MockBrokerI ¶
type MockBrokerI struct {
// contains filtered or unexported fields
}
MockBrokerI is a mock of BrokerI interface.
func NewMockBrokerI ¶
func NewMockBrokerI(ctrl *gomock.Controller) *MockBrokerI
NewMockBrokerI creates a new mock instance.
func (*MockBrokerI) EXPECT ¶
func (m *MockBrokerI) EXPECT() *MockBrokerIMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockBrokerI) SendBatch ¶
func (m *MockBrokerI) SendBatch(arg0 []events.Event)
SendBatch mocks base method.
func (*MockBrokerI) SetStreaming ¶
func (m *MockBrokerI) SetStreaming(arg0 bool) bool
SetStreaming mocks base method.
func (*MockBrokerI) Subscribe ¶
func (m *MockBrokerI) Subscribe(arg0 broker.Subscriber) int
Subscribe mocks base method.
func (*MockBrokerI) SubscribeBatch ¶
func (m *MockBrokerI) SubscribeBatch(arg0 ...broker.Subscriber)
SubscribeBatch mocks base method.
func (*MockBrokerI) Unsubscribe ¶
func (m *MockBrokerI) Unsubscribe(arg0 int)
Unsubscribe mocks base method.
type MockBrokerIMockRecorder ¶
type MockBrokerIMockRecorder struct {
// contains filtered or unexported fields
}
MockBrokerIMockRecorder is the mock recorder for MockBrokerI.
func (*MockBrokerIMockRecorder) Send ¶
func (mr *MockBrokerIMockRecorder) Send(arg0 interface{}) *gomock.Call
Send indicates an expected call of Send.
func (*MockBrokerIMockRecorder) SendBatch ¶
func (mr *MockBrokerIMockRecorder) SendBatch(arg0 interface{}) *gomock.Call
SendBatch indicates an expected call of SendBatch.
func (*MockBrokerIMockRecorder) SetStreaming ¶
func (mr *MockBrokerIMockRecorder) SetStreaming(arg0 interface{}) *gomock.Call
SetStreaming indicates an expected call of SetStreaming.
func (*MockBrokerIMockRecorder) Subscribe ¶
func (mr *MockBrokerIMockRecorder) Subscribe(arg0 interface{}) *gomock.Call
Subscribe indicates an expected call of Subscribe.
func (*MockBrokerIMockRecorder) SubscribeBatch ¶
func (mr *MockBrokerIMockRecorder) SubscribeBatch(arg0 ...interface{}) *gomock.Call
SubscribeBatch indicates an expected call of SubscribeBatch.
func (*MockBrokerIMockRecorder) Unsubscribe ¶
func (mr *MockBrokerIMockRecorder) 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.