connection

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: Unlicense Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IChannel

type IChannel interface {
	GetId() uuid.UUID
	IsOpen() bool
	Close() error
	QueueDeclare(name string, durable, autoDelete, exclusive, noWait bool, passive bool, args amqp.Table) error
	QueueBind(name, key, exchange string, noWait bool, args amqp.Table) error
	QueueDelete(name string, ifUnused, ifEmpty, noWait bool) error
	QueueUnbind(name, key, exchange string, args amqp.Table) error
	ExchangeDeclare(name, kind string, durable, autoDelete, internal, noWait, passive bool, args amqp.Table) error
	ExchangeDelete(name string, ifUnused, noWait bool) error
	PublishWithContext(ctx context.Context, exchange, key string, mandatory, immediate bool, msg amqp.Publishing) error
	Get(queue string, autoAck bool) (amqp.Delivery, bool, error)
	SetQos(prefetchCount int, prefetchSize int) error
	Consume(queue, consumer string, autoAck, exclusive, noLocal, noWait bool, args amqp.Table) (<-chan amqp.Delivery, error)
	Cancel(consumer string, noWait bool) error
}

type IChannelFactory

type IChannelFactory interface {
	New() (IChannel, error)
	Renew(channel IChannel) error
}

type RmqChannel

type RmqChannel struct {
	Id uuid.UUID
	// contains filtered or unexported fields
}

func (*RmqChannel) Cancel

func (channel *RmqChannel) Cancel(consumer string, noWait bool) error

func (*RmqChannel) Close

func (channel *RmqChannel) Close() error

func (*RmqChannel) Consume

func (channel *RmqChannel) Consume(queue, consumer string, autoAck, exclusive, noLocal, noWait bool, args amqp.Table) (<-chan amqp.Delivery, error)

func (*RmqChannel) ExchangeDeclare

func (channel *RmqChannel) ExchangeDeclare(name, kind string, durable, autoDelete, internal, noWait, passive bool, args amqp.Table) error

func (*RmqChannel) ExchangeDelete

func (channel *RmqChannel) ExchangeDelete(name string, ifUnused, noWait bool) error

func (*RmqChannel) Get

func (channel *RmqChannel) Get(queue string, autoAck bool) (amqp.Delivery, bool, error)

func (*RmqChannel) GetId

func (channel *RmqChannel) GetId() uuid.UUID

func (*RmqChannel) IsOpen

func (channel *RmqChannel) IsOpen() bool

func (*RmqChannel) PublishWithContext

func (channel *RmqChannel) PublishWithContext(ctx context.Context, exchange, key string, mandatory, immediate bool, msg amqp.Publishing) error

func (*RmqChannel) QueueBind

func (channel *RmqChannel) QueueBind(name, key, exchange string, noWait bool, args amqp.Table) error

func (*RmqChannel) QueueDeclare

func (channel *RmqChannel) QueueDeclare(name string, durable, autoDelete, exclusive, noWait bool, passive bool, args amqp.Table) error

func (*RmqChannel) QueueDelete

func (channel *RmqChannel) QueueDelete(name string, ifUnused, ifEmpty, noWait bool) error

func (*RmqChannel) QueueUnbind

func (channel *RmqChannel) QueueUnbind(name, key, exchange string, args amqp.Table) error

func (*RmqChannel) SetQos

func (channel *RmqChannel) SetQos(prefetchCount int, prefetchSize int) error

type RmqChannelFactory

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

func NewRmqChannelFactory

func NewRmqChannelFactory(connection *RmqConnection) *RmqChannelFactory

func (RmqChannelFactory) New

func (factory RmqChannelFactory) New() (IChannel, error)

func (RmqChannelFactory) Renew

func (factory RmqChannelFactory) Renew(channel IChannel) error

type RmqConnection

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

func NewConn

func NewConn(conf *common.RmqConfig) *RmqConnection

func (*RmqConnection) Close

func (conn *RmqConnection) Close() error

func (*RmqConnection) IsOpen

func (conn *RmqConnection) IsOpen() bool

func (*RmqConnection) NewChannel

func (conn *RmqConnection) NewChannel() (*RmqChannel, error)

func (*RmqConnection) Open

func (conn *RmqConnection) Open() (err error)

Jump to

Keyboard shortcuts

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