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) Close() 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) Publish(exc, route string, msg []byte, _ wabbit.Option) error
- func (ch *Channel) Reject(tag uint64, requeue bool) error
- type Delivery
- 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) Publish(exc, route string, d *Delivery, _ wabbit.Option) error
- func (v *VHost) Qos(prefetchCount, prefetchSize int, global bool) error
- func (v *VHost) QueueBind(name, key, exchange string, _ wabbit.Option) error
- func (v *VHost) QueueDeclare(name string, args wabbit.Option) (wabbit.Queue, error)
- func (v *VHost) QueueDelete(name string, args wabbit.Option) (int, error)
- func (v *VHost) QueueUnbind(name, key, exchange string, _ 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 ¶
func (s *AMQPServer) CreateChannel(connid string) (wabbit.Channel, error)
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
type Delivery ¶
type Delivery struct {
// contains filtered or unexported fields
}
Delivery is an interface to delivered messages
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) 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) QueueDelete ¶
Click to show internal directories.
Click to hide internal directories.