func (a *AMQPDriver) OpenConnection(connection interface{}, settings string) (MessageQueuer, error) {
	conn, ok := connection.(*amqp.Connection)
	if !ok {
		return nil, fmt.Errorf("ergoq: amqp connection %+v not recognized.", connection)
	}
	s, err := url.ParseQuery(settings)
	if err != nil {
		return nil, err
	}
	d := amqpMessageQueue{
		conn:     conn,
		settings: NewAMQPURLSettings(s),
	}
	return &d, nil
}
open by already instantiated connection
package ergoq
import (
	"fmt"
	"net/url"
	"github.com/streadway/amqp"
)
const (
	RELIABLE_URL_PARAM = "reliable"
	AUTO_ACK_URL_PARAM = "auto_ack"
	EXCHANGE_URL_PARAM = "exchange"
	DEF_AMQP_RELIABLE = true
	DEF_AMQP_AUTO_ACK = false
	DEF_AMQP_PREFIX   = "errgoq"
	DEF_EXCHANGE      = "errgo"
)
func init() {
	Register("amqp", &AMQPDriver{})
}
type AMQPDriver struct{}
func (a *AMQPDriver) Open(dsn string) (MessageQueuer, error) {
	pd, err := ParseAMQPDSN(dsn)
	if err != nil {
		return nil, err
	}
	conn, errDial := amqp.Dial(pd.dsn)
	if errDial != nil {
		return nil, errDial
	}
	d := amqpMessageQueue{
		conn:     conn,
		settings: pd.settings,
	}
	return &d, nil
}