common

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2021 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AMQPConnector

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

AMQPConnector is amqp connection manager

func NewAMQPConnector

func NewAMQPConnector(url string, tlsConfig *tls.Config, opts ...AMQPConnectorOption) *AMQPConnector

func (*AMQPConnector) Channel

func (ac *AMQPConnector) Channel() (*amqp.Channel, error)

func (*AMQPConnector) DeleteQueue

func (ac *AMQPConnector) DeleteQueue(channel *amqp.Channel, queueName string) error

DeleteQueue deletes a queue by name

func (*AMQPConnector) ErrChan

func (ac *AMQPConnector) ErrChan() chan error

func (*AMQPConnector) Exchange

func (ac *AMQPConnector) Exchange(exchange, exchangeType, queueName string, queueDurable, queueDelete bool, queueBindingKey string, exchangeDeclareArgs, queueDeclareArgs, queueBindingArgs amqp.Table) (*amqp.Channel, amqp.Queue, <-chan amqp.Confirmation, error)

Exchange declares an exchange, opens a channel declares and binds the queue and enables publish notifications using the existing RabbitMQ connection.

func (*AMQPConnector) InspectQueue

func (*AMQPConnector) InspectQueue(channel *amqp.Channel, queueName string) (*amqp.Queue, error)

InspectQueue provides information about a specific queue

type AMQPConnectorOption

type AMQPConnectorOption func(c *AMQPConnector)

func WithAMQPConnectionMaxRetries

func WithAMQPConnectionMaxRetries(retries int) AMQPConnectorOption

func WithAMQPConnectionRetryTimeout

func WithAMQPConnectionRetryTimeout(timeout time.Duration) AMQPConnectorOption

func WithAMQPExchangeMaxRetries

func WithAMQPExchangeMaxRetries(retries int) AMQPConnectorOption

func WithAMQPExchangeRetryTimeout

func WithAMQPExchangeRetryTimeout(timeout time.Duration) AMQPConnectorOption

type RedisConnector

type RedisConnector struct{}

RedisConnector is redis connection manager

func (*RedisConnector) NewPool

func (rc *RedisConnector) NewPool(socketPath, host, password string, db int) *redis.Pool

NewPool returns a new pool of Redis connections

Jump to

Keyboard shortcuts

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