Documentation ¶
Index ¶
- type Communicator
- type HTTPCommunicator
- func (m *HTTPCommunicator) Close() error
- func (m *HTTPCommunicator) ConsumeMediateReplyWithResponse()
- func (m *HTTPCommunicator) GetResponses() []prototype.MessagePrototype
- func (m *HTTPCommunicator) PostAndListen() (chan model.ResponseMessage, error)
- func (m *HTTPCommunicator) RequestWith(requests []prototype.MessagePrototype)
- func (m *HTTPCommunicator) RespondWith(responses []prototype.MessagePrototype)
- func (m *HTTPCommunicator) UpdateResponse(response prototype.MessagePrototype)
- type RMQExchangeCommunicator
- func (rc *RMQExchangeCommunicator) Close() error
- func (rc *RMQExchangeCommunicator) ConsumeMediateReplyWithResponse()
- func (rc *RMQExchangeCommunicator) GetResponses() []prototype.MessagePrototype
- func (rc *RMQExchangeCommunicator) PostAndListen() (chan model.ResponseMessage, error)
- func (rc *RMQExchangeCommunicator) RequestWith(request []prototype.MessagePrototype)
- func (rc *RMQExchangeCommunicator) RespondWith(response []prototype.MessagePrototype)
- func (rc *RMQExchangeCommunicator) UpdateResponse(response prototype.MessagePrototype)
- type RMQQueueListener
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Communicator ¶
type Communicator interface { RespondWith(response []prototype.MessagePrototype) RequestWith(request []prototype.MessagePrototype) GetResponses() []prototype.MessagePrototype UpdateResponse(response prototype.MessagePrototype) Close() error PostAndListen() (chan model.ResponseMessage, error) ConsumeMediateReplyWithResponse() }
Communicator is an interface the represents communicator to external source
type HTTPCommunicator ¶
type HTTPCommunicator struct {
// contains filtered or unexported fields
}
HTTPCommunicator is a communicator used to send and receive HTTP requests
func NewHTTPCommunicator ¶
func NewHTTPCommunicator(endpoint string, port uint16, client *http.Client) *HTTPCommunicator
NewHTTPCommunicator creates new communicator to send requests
func (*HTTPCommunicator) ConsumeMediateReplyWithResponse ¶
func (m *HTTPCommunicator) ConsumeMediateReplyWithResponse()
ConsumeMediateReplyWithResponse listens as a server and consumes sends messages to the channel
func (*HTTPCommunicator) GetResponses ¶
func (m *HTTPCommunicator) GetResponses() []prototype.MessagePrototype
func (*HTTPCommunicator) PostAndListen ¶
func (m *HTTPCommunicator) PostAndListen() (chan model.ResponseMessage, error)
PostAndListen posts requests to endpoint and listens for response
func (*HTTPCommunicator) RequestWith ¶
func (m *HTTPCommunicator) RequestWith(requests []prototype.MessagePrototype)
RequestWith sets the request handler
func (*HTTPCommunicator) RespondWith ¶
func (m *HTTPCommunicator) RespondWith(responses []prototype.MessagePrototype)
RespondWith sets the response handler
func (*HTTPCommunicator) UpdateResponse ¶
func (m *HTTPCommunicator) UpdateResponse(response prototype.MessagePrototype)
type RMQExchangeCommunicator ¶
type RMQExchangeCommunicator struct { ConnectionString string ConnectionRetries config.Retry // contains filtered or unexported fields }
RMQExchangeCommunicator communicator to RabbitMQ
func NewRMQExchangeCommunicator ¶
func NewRMQExchangeCommunicator(connectionString string, retries config.Retry, exchanges []config.Exchange, queues []config.Queue) *RMQExchangeCommunicator
NewRMQExchangeCommunicator creates new communicator with default connection
func (*RMQExchangeCommunicator) Close ¶
func (rc *RMQExchangeCommunicator) Close() error
Close closes connection to RMQ
func (*RMQExchangeCommunicator) ConsumeMediateReplyWithResponse ¶
func (rc *RMQExchangeCommunicator) ConsumeMediateReplyWithResponse()
ConsumeMediateReplyWithResponse opens a channel to wait for the information from rabbit mq
func (*RMQExchangeCommunicator) GetResponses ¶
func (rc *RMQExchangeCommunicator) GetResponses() []prototype.MessagePrototype
GetResponses returns responses
func (*RMQExchangeCommunicator) PostAndListen ¶
func (rc *RMQExchangeCommunicator) PostAndListen() (chan model.ResponseMessage, error)
PostAndListen sends request to exchange and waits for response
func (*RMQExchangeCommunicator) RequestWith ¶
func (rc *RMQExchangeCommunicator) RequestWith(request []prototype.MessagePrototype)
RequestWith defines requests to be sent to RMQ
func (*RMQExchangeCommunicator) RespondWith ¶
func (rc *RMQExchangeCommunicator) RespondWith(response []prototype.MessagePrototype)
RespondWith defines responses to be sent to RMQ
func (*RMQExchangeCommunicator) UpdateResponse ¶
func (rc *RMQExchangeCommunicator) UpdateResponse(response prototype.MessagePrototype)
UpdateResponse updates response
type RMQQueueListener ¶
type RMQQueueListener struct { QueueName string // contains filtered or unexported fields }
func NewRMQQueueListener ¶
func NewRMQQueueListener(queueName string, receiveChannel *amqp.Channel) *RMQQueueListener
func (*RMQQueueListener) AddListener ¶
func (ql *RMQQueueListener) AddListener(ch chan model.RequestMessage)
func (*RMQQueueListener) Listen ¶
func (ql *RMQQueueListener) Listen()