Documentation ¶
Overview ¶
This program has been developed by students from the bachelor Computer Science at Utrecht University within the Software Project course. © Copyright Utrecht University (Department of Information and Computing Sciences)
This program has been developed by students from the bachelor Computer Science at Utrecht University within the Software Project course. © Copyright Utrecht University (Department of Information and Computing Sciences)
This program has been developed by students from the bachelor Computer Science at Utrecht University within the Software Project course. © Copyright Utrecht University (Department of Information and Computing Sciences)
Index ¶
- func NewMockDriver() broker.Interface
- type MockConsumer
- type MockDriver
- func (md *MockDriver) CreateConsumer(exchangeName string, queueName string, routingKey string, ...) consumer.BrokerConsumerI
- func (md *MockDriver) CreateConsumerWithClient(exchangeName string, queueName string, routingKey string, ...) (consumer.BrokerConsumerI, producer.BrokerProducerI)
- func (md *MockDriver) CreateProducer(exchangeName string, serviceName string) producer.BrokerProducerI
- type MockProducer
- func (mp *MockProducer) PublishAnalyticsRequest(msg message.MessageFrontend, sessionID, clientID, routingKey string)
- func (mp *MockProducer) PublishErrorMessage(err error, sessionID, routingKey string)
- func (mp *MockProducer) PublishFrontendMessage(msg message.MessageFrontend, sessionID, clientID, routingKey string)
- func (mp *MockProducer) PublishFrontendSuccessMessage(typeVal string, value interface{}, sessionID, clientID, routingKey string)
- func (mp *MockProducer) PublishMessageJsonHeaders(body *[]byte, routingKey string, headers *map[string]interface{}) producer.BrokerProducerI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MockConsumer ¶
type MockConsumer struct {
// contains filtered or unexported fields
}
A MockConsumer mocks the Consumer interface
func (*MockConsumer) AddClientProducer ¶ added in v0.0.3
func (mc *MockConsumer) AddClientProducer(producer producer.BrokerProducerI)
func (*MockConsumer) ConsumeMessages ¶
func (mc *MockConsumer) ConsumeMessages() consumer.BrokerConsumerI
ConsumeMessages consumes messages from the broker (mock)
func (*MockConsumer) GetClientProducer ¶ added in v0.0.3
func (mc *MockConsumer) GetClientProducer() producer.BrokerProducerI
func (*MockConsumer) SetMessageHandler ¶
func (mc *MockConsumer) SetMessageHandler(handler func(msg *consumer.BrokerConsumerMessage, routingKey string, clientID string, sessionID string)) consumer.BrokerConsumerI
SetMessageHandler sets the message handler for this consumer (mock)
handler: func(msg *broker.Message), a functino to handle the message
type MockDriver ¶
type MockDriver struct { // Mock messages that are published by producers on this broker // Key is the routing key // Value is a slice of messages, in order of being sent 'first -> last' Messages map[string][]broker.Message }
MockDriver is a mock broker implementing the Interface
func (*MockDriver) CreateConsumer ¶
func (md *MockDriver) CreateConsumer(exchangeName string, queueName string, routingKey string, routingKeyStore keyvaluestore.Interface, serviceName string) consumer.BrokerConsumerI
CreateConsumer creates a consumer with the specified parameters (mock)
exchangeName: string, the name of the exchange to which this consumer will bind its queue queueName: string, the name of the queue this consumer will consume messages from routingKey: string, the routingKey this consumer listens to Returns: An object implementing the Consumer interface
func (*MockDriver) CreateConsumerWithClient ¶ added in v0.0.3
func (md *MockDriver) CreateConsumerWithClient(exchangeName string, queueName string, routingKey string, routingKeyStore keyvaluestore.Interface, serviceName string) (consumer.BrokerConsumerI, producer.BrokerProducerI)
func (*MockDriver) CreateProducer ¶
func (md *MockDriver) CreateProducer(exchangeName string, serviceName string) producer.BrokerProducerI
CreateProducer creates a producer with the specified parameters (mock)
exchangeName: string, the name of the exchange to which this producer will publish messages Returns: An object implementing the Producer interface
type MockProducer ¶
type MockProducer struct {
// contains filtered or unexported fields
}
A MockProducer mocks the Producer interface
func (*MockProducer) PublishAnalyticsRequest ¶ added in v0.0.3
func (mp *MockProducer) PublishAnalyticsRequest(msg message.MessageFrontend, sessionID, clientID, routingKey string)
func (*MockProducer) PublishErrorMessage ¶ added in v0.0.3
func (mp *MockProducer) PublishErrorMessage(err error, sessionID, routingKey string)
func (*MockProducer) PublishFrontendMessage ¶ added in v0.0.3
func (mp *MockProducer) PublishFrontendMessage(msg message.MessageFrontend, sessionID, clientID, routingKey string)
func (*MockProducer) PublishFrontendSuccessMessage ¶ added in v0.0.3
func (mp *MockProducer) PublishFrontendSuccessMessage(typeVal string, value interface{}, sessionID, clientID, routingKey string)
func (*MockProducer) PublishMessageJsonHeaders ¶ added in v0.0.3
func (mp *MockProducer) PublishMessageJsonHeaders(body *[]byte, routingKey string, headers *map[string]interface{}) producer.BrokerProducerI
PublishMessage publishes a message to the given queue (mock)
body: *[]byte, the body of the message routingKey: string, the routingkey of the message headers: *map[string]interface{}, the headers of the message