rabbitmq

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultHost     = "localhost"
	DefaultPort     = 5672
	DefaultUser     = "guest"
	DefaultPassword = "guest"

	ManagementUIPort = 15672

	ExchangeTypeDirect = "direct"
	ExchangeTypeTopic  = "topic"
	ExchangeTypeFanout = "fanout"
)

Variables

This section is empty.

Functions

func WithConsumerRoutingKeys

func WithConsumerRoutingKeys(routingKeys ...string) func(c *Client)

func WithExchangeName

func WithExchangeName(exchangeName string) func(c *Client)

func WithExchangeType

func WithExchangeType(exchangeType string) func(c *Client)

func WithHost added in v0.0.8

func WithHost(host string) func(c *Client)

func WithPassword added in v0.0.8

func WithPassword(password string) func(c *Client)

func WithPort

func WithPort(port uint) func(c *Client)

func WithQueueName

func WithQueueName(queueName string) func(c *Client)

func WithUser added in v0.0.8

func WithUser(user string) func(c *Client)

Types

type Acknowledger added in v0.0.5

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

func NewAcknowledger added in v0.0.5

func NewAcknowledger(delivery amqp091.Delivery) *Acknowledger

func (*Acknowledger) Ack added in v0.0.5

func (a *Acknowledger) Ack() error

func (*Acknowledger) Nack added in v0.0.5

func (a *Acknowledger) Nack(opts messages.NackOpts) error

type Client

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

func NewClient

func NewClient(opts ...ConsumerOpt) (*Client, error)

func (*Client) Close

func (r *Client) Close() error

func (*Client) Consume

func (r *Client) Consume() (<-chan messages.Message, error)

func (*Client) Publish

func (r *Client) Publish(ctx context.Context, eventData events.EventData, routingInfo events.RoutingInfo) error

TODO Move out of the client to a dedicated Publisher

func (*Client) QueueName

func (r *Client) QueueName() string

type ConsumerOpt

type ConsumerOpt func(consumer *Client)

Jump to

Keyboard shortcuts

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