Documentation
¶
Index ¶
- func FailOnError(err error, msg string)
- func StartConsumer(msg *MqDestination, receiver OnReceive, connSetting *Settings)
- func WrapRepo(msg amqp.Delivery, body []byte, headers amqp.Table) *amqp.Publishing
- type MqDestination
- func (mq *MqDestination) Consume(conn *rabbitmq.Connection, consumerTag string) (<-chan amqp.Delivery, *rabbitmq.Channel, error)
- func (mq *MqDestination) DeclareDestination(cnn *rabbitmq.Connection, createTempQueue bool) error
- func (mq *MqDestination) Produce(channel *rabbitmq.Channel, message amqp.Publishing) error
- func (mq *MqDestination) RPC(ctx context.Context, conn *rabbitmq.Connection, message amqp.Publishing) (*amqp.Delivery, error)
- type OnReceive
- type Settings
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FailOnError ¶ added in v0.0.2
FailOnError failed if any error
func StartConsumer ¶ added in v0.0.2
func StartConsumer(msg *MqDestination, receiver OnReceive, connSetting *Settings)
StartConsumer start process.
Types ¶
type MqDestination ¶
type MqDestination struct { Queue string Topic string ExchangeType string AutoAck bool Exclusive bool Prefetch int DeclareAll bool }
MqDestination Rabbitmq destination
func (*MqDestination) Consume ¶
func (mq *MqDestination) Consume(conn *rabbitmq.Connection, consumerTag string) (<-chan amqp.Delivery, *rabbitmq.Channel, error)
Consume start consumer
func (*MqDestination) DeclareDestination ¶
func (mq *MqDestination) DeclareDestination(cnn *rabbitmq.Connection, createTempQueue bool) error
DeclareDestination declare Topic, queues....
func (*MqDestination) Produce ¶
func (mq *MqDestination) Produce(channel *rabbitmq.Channel, message amqp.Publishing) error
Produce publish message
func (*MqDestination) RPC ¶ added in v0.0.4
func (mq *MqDestination) RPC(ctx context.Context, conn *rabbitmq.Connection, message amqp.Publishing) (*amqp.Delivery, error)
RPC RPC over rabbitmq message. timeout setting should be ctx
type Settings ¶
type Settings struct { Host string Port uint User string Password string Vhost string Prop amqp.Table }
Settings Settings, should include url & options
Click to show internal directories.
Click to hide internal directories.