Documentation
¶
Index ¶
- Variables
- func DefaultLogger() *zap.Logger
- func WrapRepo(msg amqp.Delivery, body []byte, headers amqp.Table) *amqp.Publishing
- type Destination
- func (mq *Destination) Consume(ch *rabbitmq.Channel, consumerTag string) (<-chan amqp.Delivery, *rabbitmq.Channel, error)
- func (mq *Destination) DeclareDestination(channel *rabbitmq.Channel, createTempQueue bool) error
- func (mq *Destination) Produce(channel *rabbitmq.Channel, message amqp.Publishing) error
- func (mq *Destination) RPC(ctx context.Context, ch *rabbitmq.Channel, message amqp.Publishing) (*amqp.Delivery, error)
- func (r *Destination) SetDefaults()
- func (destination *Destination) StartConsumer(receiver OnReceive, ch *rabbitmq.Channel, consumerTag string)
- type OnReceive
- type Settings
- func (c Settings) Close(v interface{}) error
- func (r *Settings) ConnURL() string
- func (r *Settings) Connect() (*rabbitmq.Connection, error)
- func (c Settings) Factory() (interface{}, error)
- func (c Settings) Ping(v interface{}) error
- func (r *Settings) SetDefaults()
- func (r *Settings) String() string
Constants ¶
This section is empty.
Variables ¶
SharedConnection should shared connection? default YES
Functions ¶
func DefaultLogger ¶ added in v0.3.0
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 Logger *zap.Logger }
Destination Rabbitmq destination
func (*Destination) Consume ¶ added in v0.1.1
func (mq *Destination) Consume(ch *rabbitmq.Channel, consumerTag string) (<-chan amqp.Delivery, *rabbitmq.Channel, error)
Consume start consumer
func (*Destination) DeclareDestination ¶ added in v0.1.1
func (mq *Destination) DeclareDestination(channel *rabbitmq.Channel, 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, ch *rabbitmq.Channel, message amqp.Publishing) (*amqp.Delivery, error)
RPC RPC over rabbitmq message. timeout setting should be ctx
func (*Destination) SetDefaults ¶ added in v0.3.0
func (r *Destination) SetDefaults()
func (*Destination) StartConsumer ¶ added in v0.3.0
func (destination *Destination) StartConsumer(receiver OnReceive, ch *rabbitmq.Channel, consumerTag string)
StartConsumer start process.
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 Logger *zap.Logger // contains filtered or unexported fields }
Settings Settings, should include url & options
func (*Settings) Connect ¶
func (r *Settings) Connect() (*rabbitmq.Connection, error)
Connect make connection to Rabbitmq
func (*Settings) SetDefaults ¶ added in v0.3.0
func (r *Settings) SetDefaults()
Click to show internal directories.
Click to hide internal directories.