amqp_helper

package module
v0.0.12-alpha Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2026 License: AGPL-3.0 Imports: 8 Imported by: 6

README

codeclarity-logo

Secure your software empower your team.

License

Table of Contents

CodeClarity Utility - AMQP Helper

Contributing

If you'd like to contribute code or documentation, please see CONTRIBUTING.md for guidelines on how to do so.

Reporting Issues

Please report any issues with the setup process or other problems encountered while using this repository by opening a new issue in this project's GitHub page.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Listen

func Listen(queue string, callback func(args any, config types_plugin.Plugin, message []byte), args any, config types_plugin.Plugin)

Listen starts consuming messages from the given queue. This blocks forever. It maintains its own persistent connection for consuming.

func Send

func Send(connection string, data []byte)

Send publishes a message to the given queue using a persistent singleton connection. This is backward-compatible with the original API but now reuses the connection instead of creating a new TCP connection per call.

Types

type Client

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

Client maintains a persistent AMQP connection with channel and queue declaration caching.

func NewClient

func NewClient(url string) (*Client, error)

NewClient creates a new Client with a persistent AMQP connection.

func (*Client) Close

func (c *Client) Close()

Close closes all channels and the connection.

func (*Client) SendToQueue

func (c *Client) SendToQueue(queueName string, data []byte) error

SendToQueue publishes a message to the given queue using the persistent connection. Thread-safe: uses a mutex to protect channel access.

Jump to

Keyboard shortcuts

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