wabbit

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisableAutoReconnect

func DisableAutoReconnect() func(*Connection)

func NewWrappedDelivery

func NewWrappedDelivery(d amqp.Delivery) wabbitiface.WrappedDelivery

func UseDefaultNotifiers

func UseDefaultNotifiers() func(*Connection)

Types

type Channel

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

func (*Channel) DeclareExchange

func (me *Channel) DeclareExchange(options *opts.ExchangeBindingOpts, bindQueue bool, queueOpts opts.QueueOptsMap) (exchange string, err error)

DeclareExchange queues should be verified before declaring exchange bindQueue should be true for consumers

func (*Channel) DeclareQueue

func (me *Channel) DeclareQueue(mustBind, mustVerify bool, queueOpts opts.QueueOptsMap) error

func (*Channel) SetNotifierFunc

func (me *Channel) SetNotifierFunc(fn func(error))

type Config

type Config struct {
	Host     string
	Port     string
	UserName string
	Password string
	Vhost    string
}

func (*Config) URL

func (cfg *Config) URL() string

type Connection

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

Connection wrapper around the amqp.Connection that handles reconnection automatically(unless disabled). It then calls the notofierRecovered function to notify of updates

func NewConnection

func NewConnection(cfg wabbitiface.ConfigIface, opts ...func(*Connection)) (*Connection, error)

NewConnection returns a Connection pointer

func (*Connection) Channel

func (me *Connection) Channel() (wabbitiface.WrappedChannel, error)

func (*Connection) Close

func (me *Connection) Close() error

func (*Connection) Conn

func (me *Connection) Conn() *amqp.Connection

Conn returns the underlying amqp.Connection pointer

func (*Connection) Connect

func (me *Connection) Connect() error

func (*Connection) NotifyClose

func (me *Connection) NotifyClose(ch chan *amqp.Error) chan *amqp.Error

func (*Connection) SetNotifierFunc

func (me *Connection) SetNotifierFunc(fn ...wabbitiface.Notify)

SetNotifierFunc adds a notifier function that notofies disconnection

func (*Connection) SetRecoveryFunc

func (me *Connection) SetRecoveryFunc(fn ...func(bool))

SetNotifierFunc adds a notifier function that notofies that the connection has been reestablished

type Delivery

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

func (Delivery) Ack

func (d Delivery) Ack(multiple bool) error

functions

func (Delivery) AppID

func (d Delivery) AppID() string

func (Delivery) Body

func (d Delivery) Body() []byte

func (Delivery) ConsumerTag

func (d Delivery) ConsumerTag() string

func (Delivery) ContentEncoding

func (d Delivery) ContentEncoding() string

func (Delivery) ContentType

func (d Delivery) ContentType() string

func (Delivery) CorrelationID

func (d Delivery) CorrelationID() string

func (Delivery) DeliveryMode

func (d Delivery) DeliveryMode() uint8

func (Delivery) DeliveryTag

func (d Delivery) DeliveryTag() uint64

func (Delivery) Exchange

func (d Delivery) Exchange() string

func (Delivery) Expiration

func (d Delivery) Expiration() string

func (Delivery) MessageCount

func (d Delivery) MessageCount() uint32

func (Delivery) MessageID

func (d Delivery) MessageID() string

func (Delivery) Nack

func (d Delivery) Nack(multiple, requeue bool) error

func (Delivery) Priority

func (d Delivery) Priority() uint8

func (Delivery) Redelivered

func (d Delivery) Redelivered() bool

func (Delivery) ReplyTo

func (d Delivery) ReplyTo() string

func (Delivery) RoutingKey

func (d Delivery) RoutingKey() string

func (Delivery) Timestamp

func (d Delivery) Timestamp() time.Time

func (Delivery) Type

func (d Delivery) Type() string

func (Delivery) UserID

func (d Delivery) UserID() string

Directories

Path Synopsis
example
direct/consumer command
fanout/consumer command

Jump to

Keyboard shortcuts

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