Documentation
¶
Index ¶
- Constants
- func Close(amqpuri string, connID string) error
- type AMQPServer
- type Channel
- func (ch *Channel) Ack(tag uint64, multiple bool) error
- func (ch *Channel) Cancel(consumer string, noWait bool) error
- func (ch *Channel) Close() error
- func (ch *Channel) Confirm(noWait bool) error
- func (ch *Channel) Consume(queue, consumerName string, _ wabbit.Option) (<-chan wabbit.Delivery, error)
- func (ch *Channel) Nack(tag uint64, multiple bool, requeue bool) error
- func (ch *Channel) NotifyClose(c chan wabbit.Error) chan wabbit.Error
- func (ch *Channel) NotifyPublish(confirm chan wabbit.Confirmation) chan wabbit.Confirmation
- func (ch *Channel) Publish(exc, route string, msg []byte, opt wabbit.Option) error
- func (ch *Channel) QueueInspect(name string) (wabbit.Queue, error)
- func (ch *Channel) Reject(tag uint64, requeue bool) error
- type Confirmation
- type Delivery
- func (d *Delivery) Ack(multiple bool) error
- func (d *Delivery) Body() []byte
- func (d *Delivery) ConsumerTag() string
- func (d *Delivery) DeliveryTag() uint64
- func (d *Delivery) Headers() wabbit.Option
- func (d *Delivery) MessageId() string
- func (d *Delivery) Nack(multiple, requeue bool) error
- func (d *Delivery) Reject(requeue bool) error
- type DirectExchange
- type Exchange
- type Queue
- type TopicExchange
- type VHost
- func (v *VHost) Cancel(consumer string, noWait bool) error
- func (v *VHost) ExchangeDeclare(name, kind string, opt wabbit.Option) error
- func (v *VHost) ExchangeDeclarePassive(name, kind string, opt wabbit.Option) error
- func (v *VHost) Publish(exc, route string, d *Delivery, options wabbit.Option) error
- func (v *VHost) Qos(prefetchCount, prefetchSize int, global bool) error
- func (v *VHost) QueueBind(name, key, exchange string, options wabbit.Option) error
- func (v *VHost) QueueDeclare(name string, args wabbit.Option) (wabbit.Queue, error)
- func (v *VHost) QueueDeclarePassive(name string, args wabbit.Option) (wabbit.Queue, error)
- func (v *VHost) QueueDelete(name string, args wabbit.Option) (int, error)
- func (v *VHost) QueueInspect(name string) (wabbit.Queue, error)
- func (v *VHost) QueueUnbind(name, key, exchange string, options wabbit.Option) error
Constants ¶
View Source
const (
MaxChannels int = 2 << 10
)
View Source
const (
QueueMaxLen = 2 << 8
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AMQPServer ¶
type AMQPServer struct {
// contains filtered or unexported fields
}
AMQPServer is a fake AMQP server. It handle the fake TCP connection
func Connect ¶
func Connect(amqpuri string, connID string, errBroadcast *utils.ErrBroadcast) (*AMQPServer, error)
func (*AMQPServer) CreateChannel ¶
CreateChannel returns a new fresh channel
func (*AMQPServer) Start ¶
func (s *AMQPServer) Start() error
Start a new AMQP server fake-listening on host:port
type Channel ¶
type Channel struct { *VHost // contains filtered or unexported fields }
func NewChannel ¶
func (*Channel) Consume ¶
func (ch *Channel) Consume(queue, consumerName string, _ wabbit.Option) (<-chan wabbit.Delivery, error)
Consume starts a fake consumer of queue
func (*Channel) NotifyClose ¶
NotifyClose publishs notifications about errors in the given channel
func (*Channel) NotifyPublish ¶
func (ch *Channel) NotifyPublish(confirm chan wabbit.Confirmation) chan wabbit.Confirmation
type Confirmation ¶
type Confirmation struct {
// contains filtered or unexported fields
}
func (Confirmation) Ack ¶
func (c Confirmation) Ack() bool
func (Confirmation) DeliveryTag ¶
func (c Confirmation) DeliveryTag() uint64
type Delivery ¶
type Delivery struct {
// contains filtered or unexported fields
}
Delivery is an interface to delivered messages
func NewDelivery ¶
func (*Delivery) ConsumerTag ¶
func (*Delivery) DeliveryTag ¶
type DirectExchange ¶
type DirectExchange struct {
// contains filtered or unexported fields
}
func NewDirectExchange ¶
func NewDirectExchange(name string) *DirectExchange
type TopicExchange ¶
type TopicExchange struct {
// contains filtered or unexported fields
}
func NewTopicExchange ¶
func NewTopicExchange(name string) *TopicExchange
type VHost ¶
type VHost struct {
// contains filtered or unexported fields
}
VHost is a fake AMQP virtual host
func (*VHost) ExchangeDeclare ¶
func (*VHost) ExchangeDeclarePassive ¶
func (*VHost) Publish ¶
Publish push a new message to queue data channel. The queue data channel is a buffered channel of length `QueueMaxLen`. If the queue is full, this method will block until some messages are consumed.
func (*VHost) QueueDeclare ¶
func (*VHost) QueueDeclarePassive ¶
func (*VHost) QueueDelete ¶
Click to show internal directories.
Click to hide internal directories.