Documentation
¶
Index ¶
- Variables
- func FailOnError(err error, msg string)
- func StartConsumer(destination *Destination, receiver OnReceive, connSetting *Settings)
- func WrapRepo(msg amqp.Delivery, body []byte, headers amqp.Table) *amqp.Publishing
- type Destination
- func (mq *Destination) Consume(conn *rabbitmq.Connection, consumerTag string) (<-chan amqp.Delivery, *rabbitmq.Channel, error)
- func (mq *Destination) DeclareDestination(cnn *rabbitmq.Connection, createTempQueue bool) error
- func (mq *Destination) Produce(channel *rabbitmq.Channel, message amqp.Publishing) error
- func (mq *Destination) RPC(ctx context.Context, conn *rabbitmq.Connection, message amqp.Publishing) (*amqp.Delivery, error)
- type OnReceive
- type Settings
Constants ¶
This section is empty.
Variables ¶
SharedConnection should shared connection? default YES
Functions ¶
func FailOnError ¶ added in v0.0.2
FailOnError failed if any error
func StartConsumer ¶ added in v0.0.2
func StartConsumer(destination *Destination, receiver OnReceive, connSetting *Settings)
StartConsumer start process.
Types ¶
type Destination ¶ added in v0.1.1
type Destination struct { Queue string Topic string ExchangeType string AutoAck bool Exclusive bool Prefetch int DeclareAll bool }
Destination Rabbitmq destination
func (*Destination) Consume ¶ added in v0.1.1
func (mq *Destination) Consume(conn *rabbitmq.Connection, consumerTag string) (<-chan amqp.Delivery, *rabbitmq.Channel, error)
Consume start consumer
func (*Destination) DeclareDestination ¶ added in v0.1.1
func (mq *Destination) DeclareDestination(cnn *rabbitmq.Connection, createTempQueue bool) error
DeclareDestination declare Topic, queues....
func (*Destination) Produce ¶ added in v0.1.1
func (mq *Destination) Produce(channel *rabbitmq.Channel, message amqp.Publishing) error
Produce publish message
func (*Destination) RPC ¶ added in v0.1.1
func (mq *Destination) 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 `default:"localhost"` Port uint `default:"5672"` User string `default:"guest"` Password string `default:"guest"` Vhost string `default:"/"` Prop amqp.Table // contains filtered or unexported fields }
Settings Settings, should include url & options
Click to show internal directories.
Click to hide internal directories.