Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMockDelivery ¶
func NewMockDelivery(data []byte, tag uint64, acknowledger *MockAcknowledger) amqp.Delivery
NewMockDelivery creates an amqp.Delivery from a parsed log entry, filling only the properties to used by the processor code.
Types ¶
type EsClientMock ¶
type EsClientMock struct {
Indexes map[string][]models.ESDocument
}
EsClientMock is a mock Elasticsearch client used in tests.
func NewESClientMock ¶
func NewESClientMock(indexes map[string][]models.ESDocument) *EsClientMock
func (*EsClientMock) BulkUpload ¶
func (m *EsClientMock) BulkUpload(dataUnits []models.ESDocument, indexName string)
BulkUpload mocks the BulkUpload function of the EsClient interface.
func (*EsClientMock) CreateEsIndex ¶
func (m *EsClientMock) CreateEsIndex(index string)
CreateEsIndex mocks the CreateEsIndex function of the EsClient interface.
type MessageConsumerMock ¶
type MessageConsumerMock struct { TestData testmodels.TestProcessedData // contains filtered or unexported fields }
MessageConsumerMock is a mock MessageConsumer consumer used in tests.
func NewMessageConsumerMock ¶
func NewMessageConsumerMock( testData testmodels.TestProcessedData, allMessagesAcknowledged chan bool, deliveryDelaySeconds int, expectedDocCount int, ) *MessageConsumerMock
NewMessageConsumerMock creates a new mock consumer for providing processed data messages for the ulpoader service. The testData will be used to create the processed data messages from. The done channel is used to signal after all messages have been acknowledged. The deliveryDelaySeconds is used to add an artificial delay after the first message, to test the timed index recreation behaviour, it is ignored if set to zero.
func (*MessageConsumerMock) CloseChannelAndConnection ¶
func (m *MessageConsumerMock) CloseChannelAndConnection()
func (*MessageConsumerMock) Connect ¶
func (m *MessageConsumerMock) Connect()
type MockAcknowledger ¶
type MockAcknowledger struct {
// contains filtered or unexported fields
}
MockAcknowledger implements the Acknowledger interface of amqp.
func NewMockAcknowleder ¶
func NewMockAcknowleder(expectedAckCount int, allMessagesAcknowledged chan bool) *MockAcknowledger
func (*MockAcknowledger) Ack ¶
func (m *MockAcknowledger) Ack(tag uint64, multiple bool) error
Ack is the implementation of the Ack() function of the Acknowledger interface.