iamqp

package module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel = amqp.Channel

type ConcreteChannel

type ConcreteChannel struct {
	*amqp.Channel
	// contains filtered or unexported fields
}

func NewChannel

func NewChannel(c *amqp.Channel, url string) *ConcreteChannel

func NewChannelWithURI

func NewChannelWithURI(c *amqp.Channel, uri URI) *ConcreteChannel

func (*ConcreteChannel) Consume

func (r *ConcreteChannel) Consume(queue, consumer string, autoAck, exclusive, noLocal, noWait bool, args Table) (<-chan ExtDelivery, error)

func (*ConcreteChannel) Get

func (r *ConcreteChannel) Get(queue string, autoAck bool) (msg ExtDelivery, ok bool, err error)

func (*ConcreteChannel) GetURI

func (r *ConcreteChannel) GetURI() (URI, bool)

func (*ConcreteChannel) PublishWithContext

func (r *ConcreteChannel) PublishWithContext(_ context.Context, exchange, key string, mandatory, immediate bool, msg Publishing) error

func (*ConcreteChannel) RawConsume

func (r *ConcreteChannel) RawConsume(queue, consumer string, autoAck, exclusive, noLocal, noWait bool, args Table) (<-chan Delivery, error)

func (*ConcreteChannel) WrapDelivery

func (r *ConcreteChannel) WrapDelivery(delivery *Delivery, queue string, autoAck bool) ExtDelivery

type ConcreteDelivery

type ConcreteDelivery struct {
	// contains filtered or unexported fields
}

func NewDelivery

func NewDelivery(raw *Delivery, queue string, autoAck bool) *ConcreteDelivery

func (*ConcreteDelivery) AutoAck

func (c *ConcreteDelivery) AutoAck() bool

func (*ConcreteDelivery) Queue

func (c *ConcreteDelivery) Queue() string

func (*ConcreteDelivery) Raw

func (c *ConcreteDelivery) Raw() *Delivery

func (*ConcreteDelivery) RunOnScopeWithContext

func (c *ConcreteDelivery) RunOnScopeWithContext(ctx context.Context, handler Handler)

func (*ConcreteDelivery) RunWithContext

func (c *ConcreteDelivery) RunWithContext(ctx context.Context) (context.Context, func(err error))

type Confirmation

type Confirmation = amqp.Confirmation

type Consumer

type Consumer interface {
	Consume(queue, consumer string, autoAck, exclusive, noLocal, noWait bool, args Table) (<-chan ExtDelivery, error)
}

type Delivery

type Delivery = amqp.Delivery

type Error

type Error = amqp.Error

type ExtChannel

type ExtChannel interface {
	Publisher
	Consumer
	Ack(tag uint64, multiple bool) error
	Cancel(consumer string, noWait bool) error
	Close() error
	Confirm(noWait bool) error
	ExchangeBind(destination, key, source string, noWait bool, args Table) error
	ExchangeDeclare(name, kind string, durable, autoDelete, internal, noWait bool, args Table) error
	ExchangeDeclarePassive(name, kind string, durable, autoDelete, internal, noWait bool, args Table) error
	ExchangeDelete(name string, ifUnused, noWait bool) error
	ExchangeUnbind(destination, key, source string, noWait bool, args Table) error
	Flow(active bool) error
	Get(queue string, autoAck bool) (msg ExtDelivery, ok bool, err error)
	Nack(tag uint64, multiple bool, requeue bool) error
	NotifyCancel(c chan string) chan string
	NotifyClose(c chan *Error) chan *Error
	NotifyConfirm(ack, nack chan uint64) (chan uint64, chan uint64)
	NotifyFlow(c chan bool) chan bool
	NotifyPublish(confirm chan Confirmation) chan Confirmation
	NotifyReturn(c chan Return) chan Return

	Qos(prefetchCount, prefetchSize int, global bool) error
	QueueBind(name, key, exchange string, noWait bool, args Table) error
	QueueDeclare(name string, durable, autoDelete, exclusive, noWait bool, args Table) (Queue, error)
	QueueDeclarePassive(name string, durable, autoDelete, exclusive, noWait bool, args Table) (Queue, error)
	QueueDelete(name string, ifUnused, ifEmpty, noWait bool) (int, error)
	QueueInspect(name string) (Queue, error)
	QueuePurge(name string, noWait bool) (int, error)
	QueueUnbind(name, key, exchange string, args Table) error
	Recover(requeue bool) error
	Reject(tag uint64, requeue bool) error
	Tx() error
	TxCommit() error
	TxRollback() error

	GetURI() (URI, bool)
}

ExtChannel is interface for enhance iamqp.Channel Drop Publish, PublishWithDeferredConfirm method

type ExtDelivery

type ExtDelivery interface {
	Raw() *Delivery
	AutoAck() bool
	Queue() string

	RunWithContext(ctx context.Context) (context.Context, func(err error))
	RunOnScopeWithContext(ctx context.Context, handler Handler)
}

type Handler

type Handler func(context.Context, *Delivery) error

Handler accepts Context and Delivery and return error maybe only record info

type InternalConsumer

type InternalConsumer interface {
	RawConsume(queue, consumer string, autoAck, exclusive, noLocal, noWait bool, args Table) (<-chan Delivery, error)
	WrapDelivery(delivery *Delivery, queue string, autoAck bool) ExtDelivery
}

InternalConsumer for internal to reduce create goroutine

type Publisher

type Publisher interface {
	PublishWithContext(ctx context.Context, exchange, key string, mandatory, immediate bool, msg Publishing) error
}

type Publishing

type Publishing = amqp.Publishing

type Queue

type Queue = amqp.Queue

type Return

type Return = amqp.Return

type Table

type Table = amqp.Table

type URI

type URI = amqp.URI

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL