Versions in this module Expand all Collapse all v1 v1.0.1 Sep 8, 2025 Changes in this version + type Client struct + func NewClient(config Config) *Client + func (c *Client) Close() error + func (c *Client) Connect(ctx context.Context) error + func (c *Client) DeclareExchange(name, kind string, durable, autoDelete, internal bool, args amqp.Table) error + func (c *Client) DeclareQueue(name string, durable, autoDelete, exclusive bool, args amqp.Table) (amqp.Queue, error) + func (c *Client) GetChannel() (*amqp.Channel, error) + func (c *Client) GetConnection() (*amqp.Connection, error) + func (c *Client) IsConnected() bool + func (c *Client) PublishMessage(exchange, routingKey string, mandatory, immediate bool, msg amqp.Publishing) error + func (c *Client) QueueBind(name, key, exchange string, noWait bool, args amqp.Table) error + type Config struct + DebugLog bool + Logger Logger + MaxReconnectAttempt int + ReconnectInterval time.Duration + URLs []string + type DefaultLogger struct + func NewDefaultLogger(debugEnabled bool) *DefaultLogger + func (l *DefaultLogger) Debug(msg string, args ...interface{}) + func (l *DefaultLogger) Error(msg string, args ...interface{}) + func (l *DefaultLogger) Info(msg string, args ...interface{}) + func (l *DefaultLogger) Warn(msg string, args ...interface{}) + type LoadBalanceStrategy int + const LeastUsed + const Random + const RoundRobin + const WeightedRoundRobin + type Logger interface + Debug func(msg string, args ...interface{}) + Error func(msg string, args ...interface{}) + Info func(msg string, args ...interface{}) + Warn func(msg string, args ...interface{}) + type NodeConnection struct + Client *Client + URL string + type NodeStats struct + Connected bool + Failures int64 + Healthy bool + LastUsed string + TotalUsed int64 + URL string + Weight int + type Pool struct + func NewPool(config PoolConfig) *Pool + func (p *Pool) Close() error + func (p *Pool) GetClient() (*Client, error) + func (p *Pool) GetHealthyNodeCount() int + func (p *Pool) GetStats() PoolStats + func (p *Pool) SetNodeWeight(url string, weight int) error + func (p *Pool) Start() error + type PoolConfig struct + DebugLog bool + HealthCheckInterval time.Duration + LoadBalanceStrategy LoadBalanceStrategy + Logger Logger + MaxReconnectAttempt int + ReconnectInterval time.Duration + URLs []string + type PoolStats struct + HealthyNodes int + NodesStats []NodeStats + TotalFailures int64 + TotalNodes int + TotalRequests int64