Documentation ¶
Index ¶
- Constants
- type CommandMessage
- type CommandsMetrics
- type CommandsReceiver
- type CommandsSender
- type ErrMetricsFunc
- type PingMessage
- type PingStatus
- type RabbitCommandsTransport
- func (t *RabbitCommandsTransport) AddHandler(command string, handler ReceiverHandler)
- func (t *RabbitCommandsTransport) Close()
- func (t *RabbitCommandsTransport) ReceiveCommands(command string) (<-chan CommandMessage, error)
- func (t *RabbitCommandsTransport) ReceivePings(command string) error
- func (t *RabbitCommandsTransport) SendCommand(cmd CommandMessage, queue string) error
- func (t *RabbitCommandsTransport) SetErrorMetrics(metrics CommandsMetrics)
- func (t *RabbitCommandsTransport) Start(command string) error
- type ReceiverHandler
Constants ¶
View Source
const ( RCommandPing = PingStatus(0) RCommandPong = PingStatus(1) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommandMessage ¶
type CommandsMetrics ¶
type CommandsReceiver ¶
type CommandsReceiver interface { ReceiveCommands(command string) (<-chan CommandMessage, error) AddHandler(command string, handler ReceiverHandler) SetErrorMetrics(metrics CommandsMetrics) Start(command string) error Close() }
type CommandsSender ¶
type CommandsSender interface {
SendCommand(cmd CommandMessage, queue string) error
}
type ErrMetricsFunc ¶
type ErrMetricsFunc func(command string)
type PingMessage ¶
type PingMessage struct {
Status PingStatus
}
type PingStatus ¶
type PingStatus int
type RabbitCommandsTransport ¶
type RabbitCommandsTransport struct {
// contains filtered or unexported fields
}
func NewRabbitCommandsTransport ¶
func NewRabbitCommandsTransport(conn *amqp.Connection, logger *zap.Logger) (*RabbitCommandsTransport, error)
func (*RabbitCommandsTransport) AddHandler ¶
func (t *RabbitCommandsTransport) AddHandler(command string, handler ReceiverHandler)
AddHandler add command handler
func (*RabbitCommandsTransport) Close ¶
func (t *RabbitCommandsTransport) Close()
func (*RabbitCommandsTransport) ReceiveCommands ¶
func (t *RabbitCommandsTransport) ReceiveCommands(command string) (<-chan CommandMessage, error)
func (*RabbitCommandsTransport) ReceivePings ¶
func (t *RabbitCommandsTransport) ReceivePings(command string) error
func (*RabbitCommandsTransport) SendCommand ¶
func (t *RabbitCommandsTransport) SendCommand(cmd CommandMessage, queue string) error
func (*RabbitCommandsTransport) SetErrorMetrics ¶
func (t *RabbitCommandsTransport) SetErrorMetrics(metrics CommandsMetrics)
SetErrorMetrics add metrics interface to save metrics commands usage
func (*RabbitCommandsTransport) Start ¶
func (t *RabbitCommandsTransport) Start(command string) error
Start starts handling command requests
type ReceiverHandler ¶
type ReceiverHandler func(m CommandMessage) error
Click to show internal directories.
Click to hide internal directories.