rabbitmq

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMessage

func NewMessage() v2.Message

func NewPublisher

func NewPublisher(options *PublisherOptions) v2.Publisher

func NewSubscriber

func NewSubscriber(options *SubscriberOptions) v2.Subscriber

Types

type Connection

type Connection interface {
	GetConn() *amqp.Connection
	GetChannel() *amqp.Channel
	SetReconnectHooks(...func())
}

func NewConnection

func NewConnection(options *ConnectionOptions) Connection

type ConnectionOptions

type ConnectionOptions struct {
	URI                    string
	InitialBackoffInterval time.Duration
	MaxBackoffInterval     time.Duration
}

type ExchangeOptions

type ExchangeOptions struct {
	Name          string
	Type          ExchangeType
	IsDurable     bool
	IsAutoDeleted bool
	IsInternal    bool
	NoWait        bool
	Args          map[string]interface{}
}

type ExchangeType

type ExchangeType uint8
const (
	ExchangeTypeDirect ExchangeType = iota
	ExchangeTypeFanout
	ExchangeTypeTopic
	ExchangeTypeHeaders
)

func (ExchangeType) String

func (t ExchangeType) String() string

func (ExchangeType) Value

func (t ExchangeType) Value() ExchangeType

type Message

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

func (*Message) Ack

func (m *Message) Ack() error

func (*Message) AppID

func (m *Message) AppID() string

func (*Message) Body

func (m *Message) Body() []byte

func (*Message) ContentEncoding

func (m *Message) ContentEncoding() string

func (*Message) ContentType

func (m *Message) ContentType() string

func (*Message) CorrelationID

func (m *Message) CorrelationID() uuid.UUID

func (*Message) DeliveryMode

func (m *Message) DeliveryMode() uint8

func (*Message) Expiration

func (m *Message) Expiration() time.Duration

func (*Message) GetHeader

func (m *Message) GetHeader(key string) interface{}

func (*Message) Headers

func (m *Message) Headers() map[string]interface{}

func (*Message) ID

func (m *Message) ID() uuid.UUID

func (*Message) Nack

func (m *Message) Nack() error

func (*Message) Priority

func (m *Message) Priority() uint8

func (*Message) Reject

func (m *Message) Reject() error

func (*Message) ReplyTo

func (m *Message) ReplyTo() string

func (*Message) SetAppID

func (m *Message) SetAppID(appID string) v2.Message

func (*Message) SetBody

func (m *Message) SetBody(body []byte) v2.Message

func (*Message) SetContentEncoding

func (m *Message) SetContentEncoding(v string) v2.Message

func (*Message) SetContentType

func (m *Message) SetContentType(v string) v2.Message

func (*Message) SetCorrelationID

func (m *Message) SetCorrelationID(id uuid.UUID) v2.Message

func (*Message) SetDeliveryModePersistent

func (m *Message) SetDeliveryModePersistent() v2.Message

func (*Message) SetExpiration

func (m *Message) SetExpiration(expiration time.Duration) v2.Message

func (*Message) SetHeader

func (m *Message) SetHeader(key string, value interface{}) v2.Message

func (*Message) SetHeaders

func (m *Message) SetHeaders(headers map[string]interface{}) v2.Message

func (*Message) SetPriority

func (m *Message) SetPriority(priority uint8) v2.Message

func (*Message) SetReplyTo

func (m *Message) SetReplyTo(v string) v2.Message

func (*Message) SetTimestamp

func (m *Message) SetTimestamp(timestamp time.Time) v2.Message

func (*Message) SetType

func (m *Message) SetType(v string) v2.Message

func (*Message) SetUserID

func (m *Message) SetUserID(useID string) v2.Message

func (*Message) Timestamp

func (m *Message) Timestamp() time.Time

func (*Message) Type

func (m *Message) Type() string

func (*Message) UserID

func (m *Message) UserID() string

type PublishOptions

type PublishOptions struct {
	Exchange    string
	RoutingKey  string
	IsMandatory bool
	IsImmediate bool
}

type PublisherOptions

type PublisherOptions struct {
	ConnectionOptions *ConnectionOptions
}

type QueueOptions

type QueueOptions struct {
	Name          string
	Durable       bool
	AutoDelete    bool
	Exclusive     bool
	NoWait        bool
	MaxPriority   uint8
	RoutingKey    string
	QueueBindArgs map[string]interface{}
}

func (*QueueOptions) GetArgs

func (o *QueueOptions) GetArgs() amqp.Table

type SubscriberOptions

type SubscriberOptions struct {
	ConnectionOptions *ConnectionOptions
	QueueOptions      *QueueOptions
	ExchangeOptions   *ExchangeOptions
	PrefetchCount     int
	Name              string
	AutoAck           bool
	NoWait            bool
	NoLocal           bool
	Exclusive         bool
	Args              map[string]interface{}
}

Jump to

Keyboard shortcuts

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