func ConfigFromURI(amqpUri string) (*Config, error) {
	uri, err := amqp.ParseURI(amqpUri)
	if err != nil {
		return nil, err
	}
	config := &Config{
		Addr:     uri.Host,
		Port:     uri.Port,
		Vhost:    uri.Vhost,
		Username: uri.Username,
		Password: uri.Password,
	}
	config.EnableTLS = (uri.Scheme == "amqps")
	return config, nil
}
ConfigFromURI attempts to parse the given AMQP URI according to the spec
and return a relay config based on it.
See http://www.rabbitmq.com/uri-spec.html.

Default values for the fields are:

Scheme: amqp
Host: localhost
Port: 5672
Username: guest
Password: guest
Vhost: /
package relay
import (
	"fmt"
	"log"
	"sync"
	"time"
	"github.com/armon/relay/broker"
	"github.com/streadway/amqp"
)
type Config struct {
	Addr                  string         
	Port                  int            
	Vhost                 string         
	Username              string         
	Password              string         
	EnableTLS             bool           
	PrefetchCount         int            
	EnableMultiAck        bool           
	DisablePublishConfirm bool           
	DisablePersistence    bool           
	Exchange              string         
	ExchangeType          string         
	Serializer            Serializer     
	MessageTTL            time.Duration  
	QueueTTL              time.Duration  
}
type Relay struct {
	sync.Mutex
	conf     *Config
	pubConn  *amqp.Connection  
	consConn *amqp.Connection  
}
var ChannelClosed = fmt.Errorf("Channel closed!")
var TimedOut = fmt.Errorf("Timeout")