amqpclient

package module
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2022 License: Apache-2.0 Imports: 10 Imported by: 1

README

amqp-client

AMQP Go client that reconnects and reopens channels automatically

Documentation

Overview

package

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotReady              = errors.New("connection/channel not ready for use")
	ErrAlreadyClosed         = errors.New("manager already closed: not connected to server")
	ErrServerAckTimeout      = errors.New("waiting for server message ack timed out")
	ErrNoMessageConfirmation = errors.New("server did not confirm message receipt")
)

Functions

This section is empty.

Types

type ConnectionManager

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

func NewConnectionManager

func NewConnectionManager(log logr.Logger, addr string) (*ConnectionManager, error)

func (*ConnectionManager) Channel

func (m *ConnectionManager) Channel() (*amqp091.Channel, error)

func (*ConnectionManager) Close

func (m *ConnectionManager) Close() error

func (*ConnectionManager) WithChannel

func (m *ConnectionManager) WithChannel(fn func(ch *amqp091.Channel) error) error

func (*ConnectionManager) WithChannelAndConfirmation

func (m *ConnectionManager) WithChannelAndConfirmation(fn func(ch *amqp091.Channel) error) error

type SimpleClient

type SimpleClient struct {
	Manager *ConnectionManager
	// contains filtered or unexported fields
}

func NewSimpleClient

func NewSimpleClient(log logr.Logger, addr string) (*SimpleClient, error)

func (*SimpleClient) Close

func (c *SimpleClient) Close() error

func (*SimpleClient) Publish

func (c *SimpleClient) Publish(ctx context.Context, msg SimpleMessage) error

type SimpleMessage

type SimpleMessage struct {
	AppID        string
	ExchangeName string
	QueueName    string
	ContentType  string
	Body         []byte
}

Jump to

Keyboard shortcuts

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