Documentation ¶
Index ¶
- type Channel
- func (this *Channel) Ack(tag uint64, multiple bool) error
- func (this *Channel) Cancel(consumer string, noWait bool) error
- func (this *Channel) Close() error
- func (this *Channel) Confirm(noWait bool) error
- func (this *Channel) Consume(queue, consumer string, autoAck, exclusive, noLocal, noWait bool, ...) (<-chan amqp.Delivery, error)
- func (this *Channel) ExchangeBind(destination, key, source string, noWait bool, args amqp.Table) error
- func (this *Channel) ExchangeDeclare(name string, kind string, durable bool, autoDelete bool, internal bool, ...) error
- func (this *Channel) ExchangeDeclarePassive(name string, kind string, durable bool, autoDelete bool, internal bool, ...) error
- func (this *Channel) ExchangeDelete(name string, ifUnused, noWait bool) error
- func (this *Channel) ExchangeUnbind(destination, key, source string, noWait bool, args amqp.Table) error
- func (this *Channel) Flow(active bool) error
- func (this *Channel) Get(queue string, autoAck bool) (msg amqp.Delivery, ok bool, err error)
- func (this *Channel) GetNextPublishSeqNo() uint64
- func (this *Channel) IsClosed() bool
- func (this *Channel) Nack(tag uint64, multiple bool, requeue bool) error
- func (this *Channel) OnCancel(handler func(c string))
- func (this *Channel) OnClose(handler func(err *amqp.Error))
- func (this *Channel) OnFlow(handler func(c bool))
- func (this *Channel) OnPublish(handler func(c amqp.Confirmation))
- func (this *Channel) OnReconnect(handler func(channel *Channel))
- func (this *Channel) OnReturn(handler func(r amqp.Return))
- func (this *Channel) Publish(exchange string, key string, mandatory bool, immediate bool, ...) error
- func (this *Channel) PublishWithContext(ctx context.Context, exchange string, key string, mandatory bool, ...) error
- func (this *Channel) PublishWithDeferredConfirm(exchange, key string, mandatory, immediate bool, msg amqp.Publishing) (*amqp.DeferredConfirmation, error)
- func (this *Channel) PublishWithDeferredConfirmWithContext(ctx context.Context, exchange string, key string, mandatory bool, ...) (*amqp.DeferredConfirmation, error)
- func (this *Channel) Qos(prefetchCount int, prefetchSize int, global bool) error
- func (this *Channel) QueueBind(name string, key string, exchange string, noWait bool, args amqp.Table) error
- func (this *Channel) QueueDeclare(name string, durable bool, autoDelete bool, exclusive bool, noWait bool, ...) (amqp.Queue, error)
- func (this *Channel) QueueDeclarePassive(name string, durable bool, autoDelete bool, exclusive bool, noWait bool, ...) (amqp.Queue, error)
- func (this *Channel) QueueDelete(name string, ifUnused, ifEmpty, noWait bool) (int, error)
- func (this *Channel) QueuePurge(name string, noWait bool) (int, error)
- func (this *Channel) QueueUnbind(name, key, exchange string, args amqp.Table) error
- func (this *Channel) Reject(tag uint64, requeue bool) error
- func (this *Channel) Tx() error
- func (this *Channel) TxCommit() error
- func (this *Channel) TxRollback() error
- type Config
- type Connection
- func (this *Connection) Channel() (*Channel, error)
- func (this *Connection) Close() error
- func (this *Connection) ConnectionState() tls.ConnectionState
- func (this *Connection) IsClosed() bool
- func (this *Connection) LocalAddr() net.Addr
- func (this *Connection) OnClose(handler func(err *amqp.Error))
- func (this *Connection) OnReconnect(handler func(conn *Connection))
- func (this *Connection) RemoteAddr() net.Addr
- func (this *Connection) UpdateSecret(newSecret, reason string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Channel ¶
type Channel struct {
// contains filtered or unexported fields
}
func (*Channel) Consume ¶
func (this *Channel) Consume(queue, consumer string, autoAck, exclusive, noLocal, noWait bool, args amqp.Table) (<-chan amqp.Delivery, error)
Consume
queue - 队列名称
consumer - 消费者名称
autoAck - 是否自动应答
exclusive - 是否独占
noLocal - 设置为 true,表示不能将同一个 Connection 中生产者发送的消息传递给这个 Connection 中的消费者
noWait - 是否阻塞
args - 其它参数
func (*Channel) ExchangeBind ¶
func (*Channel) ExchangeDeclare ¶
func (*Channel) ExchangeDeclarePassive ¶
func (*Channel) ExchangeDelete ¶
func (*Channel) ExchangeUnbind ¶
func (*Channel) GetNextPublishSeqNo ¶
func (*Channel) OnPublish ¶
func (this *Channel) OnPublish(handler func(c amqp.Confirmation))
func (*Channel) OnReconnect ¶
func (*Channel) Publish ¶
func (this *Channel) Publish(exchange string, key string, mandatory bool, immediate bool, msg amqp.Publishing) error
Publish
exchange - 交换机名称
key - Key
mandatory - 如果为 true,根据自身 exchange 类型和 route key 规则无法找到符合条件的队列会把消息返还给发送者
immediate - 如果为 true,当 exchange 发送消息到队列后发现队列上没有消费者,则会把消息返还给发送者,在 RabbitMQ 3.0以后的版本里,去掉了immediate参数的支持
msg - 消息内容
func (*Channel) PublishWithContext ¶
func (*Channel) PublishWithDeferredConfirm ¶
func (this *Channel) PublishWithDeferredConfirm(exchange, key string, mandatory, immediate bool, msg amqp.Publishing) (*amqp.DeferredConfirmation, error)
func (*Channel) PublishWithDeferredConfirmWithContext ¶
func (*Channel) QueueDeclare ¶
func (this *Channel) QueueDeclare(name string, durable bool, autoDelete bool, exclusive bool, noWait bool, args amqp.Table) (amqp.Queue, error)
QueueDeclare
name - 队列名称
durable - 是否持久化
autoDelete - 是否自动删除
exclusive - 是否独占
noWait - 是否阻塞
args - 其它参数
func (*Channel) QueueDeclarePassive ¶
func (*Channel) QueueDelete ¶
func (*Channel) QueueUnbind ¶
func (*Channel) TxRollback ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func (*Connection) Channel ¶
func (this *Connection) Channel() (*Channel, error)
func (*Connection) Close ¶
func (this *Connection) Close() error
func (*Connection) ConnectionState ¶
func (this *Connection) ConnectionState() tls.ConnectionState
func (*Connection) IsClosed ¶
func (this *Connection) IsClosed() bool
func (*Connection) LocalAddr ¶
func (this *Connection) LocalAddr() net.Addr
func (*Connection) OnClose ¶
func (this *Connection) OnClose(handler func(err *amqp.Error))
func (*Connection) OnReconnect ¶
func (this *Connection) OnReconnect(handler func(conn *Connection))
func (*Connection) RemoteAddr ¶
func (this *Connection) RemoteAddr() net.Addr
func (*Connection) UpdateSecret ¶
func (this *Connection) UpdateSecret(newSecret, reason string) error
Click to show internal directories.
Click to hide internal directories.