amqp_wrapper_lib

package module
v0.0.0-...-32e07d9 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2018 License: Apache-2.0 Imports: 5 Imported by: 2

README

a wrapper for amqp (rabbitmq) connections

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

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

func Init

func Init(url string, resources []string, reconnectTimeout int64) (result *Connection, err error)

func (*Connection) Close

func (this *Connection) Close()

func (*Connection) Consume

func (this *Connection) Consume(qname string, resource string, worker ConsumerFunc) (err error)

func (*Connection) Init

func (this *Connection) Init(url string, resources []string, reconnectTimeout time.Duration, consumer map[string]ConsumerInfo) (err error)

func (*Connection) Publish

func (this *Connection) Publish(resource string, payload []byte) error

func (*Connection) SetMessageLogging

func (this *Connection) SetMessageLogging(logging bool)

func (*Connection) UseChannel

func (this *Connection) UseChannel(worker func(channel *amqp.Channel)) (err error)

locks channel to worker to safely reinitiate it if channel closing error occurs

type ConsumerFunc

type ConsumerFunc func(delivery []byte) error

type ConsumerInfo

type ConsumerInfo struct {
	Worker   ConsumerFunc
	QName    string
	Resource string
}

Jump to

Keyboard shortcuts

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