func (a *RabbitMQConfig) URI() string {
	tokens := strings.Split(a.Address, ":")
	var port string
	if len(tokens) == 2 {
		port = tokens[1]
	} else {
		port = strconv.Itoa(amqpDefaultPort)
	}
	uri := fmt.Sprintf("amqp://%s:%s@%s:%s", a.User, a.Password, tokens[0], port)
	return uri
}
URI returns the AMQP URI for a configuration, prefixed with amqp://.
In case the RabbitMQ address lacks a port, the default port will be used.
package main
import (
	"bytes"
	"encoding/json"
	"fmt"
	"net/http"
	"strconv"
	"strings"
	"time"
	rabbithole "github.com/michaelklishin/rabbit-hole/v2"
	"github.com/streadway/amqp"
)
const (
	amqpDefaultPort = 5672
	apiDefaultPort  = 15672
)
type (
	ExchangeType string
	QueueType string
	BindingType string
)
const (
	Direct ExchangeType = "direct"
	Headers = "headers"
	Fanout = "fanout"
	Topic = "topic"
	Classic QueueType = "classic"
	Quorum = "quorum"
	ToQueue BindingType = "queue"
	ToExchange = "exchange"
)
type Provider interface {
	CreateExchange(exchange Exchange) error
	CreateQueue(queue Queue) (string, error)
	CreateBinding(binding Binding) error
	GetExchanges(filter func(exchange Exchange) bool) ([]Exchange, error)
	GetQueues(filter func(queue Queue) bool) ([]Queue, error)
	GetBindings(filter func(binding Binding) bool) ([]Binding, error)
	GetMessages(queue Queue, max int, requeue bool) ([]Message, error)
	PublishMessage(message Message) error
	DeleteExchange(exchange Exchange) error
	DeleteQueue(queue Queue) error
}
type RabbitMQConfig struct {
	Address string
	User string
	Password string
}