rmq

package
v0.0.0-...-aac5273 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2017 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// declare flags
	Durable   = uint(0x1)
	Exclusive = uint(0x2)

	// publish flags
	Mandatory = uint(0x1)
	Immediate = uint(0x2)
)

Variables

This section is empty.

Functions

func BasicConsume

func BasicConsume(c *Channel, queue string, ctag string, callback ConsumerCallback) error

func BasicPublish

func BasicPublish(c *Channel, exchange string, rk string, body []byte, headers map[string]interface{}, flags uint) error

func ExchangeDeclare

func ExchangeDeclare(c *Channel, exchange, typ string, flags uint) error

func QueueBind

func QueueBind(c *Channel, name, key, exchange string, args map[string]interface{}) error

func QueueDeclare

func QueueDeclare(c *Channel, queue string, flags uint) error

Types

type Channel

type Channel = amqp.Channel

type Consumer

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

func (*Consumer) Tag

func (c *Consumer) Tag() string

type ConsumerCallback

type ConsumerCallback func(msg *Message)

type Exchange

type Exchange struct {
	Headers string
	Topic   string
}

type Message

type Message struct {
	Body    []byte
	Headers map[string]interface{}
	// contains filtered or unexported fields
}

func (*Message) Ack

func (m *Message) Ack(success bool) error

func (*Message) AckMultiple

func (m *Message) AckMultiple(success bool) error

func (*Message) Reject

func (m *Message) Reject(requeue bool) error

type RMQ

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

func Connect

func Connect(host string) (*RMQ, error)

func ConnectAndAnnounce

func ConnectAndAnnounce(sett *Settings) (*RMQ, error)

func (*RMQ) Channel

func (r *RMQ) Channel(name string, prefetchCount int) (*Channel, error)

type Return

type Return = amqp.Return

type Service

type Service struct {
	Queue      string
	RoutingKey string
}

type Settings

type Settings struct {
	Amqp     string
	Exchange Exchange
	Services map[string]Service
}

Jump to

Keyboard shortcuts

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