This commit is contained in:
shoopea 2019-06-28 12:57:40 +08:00
parent 2ebd392087
commit da7c548639
3 changed files with 3 additions and 4 deletions

2
def.go
View File

@ -29,7 +29,7 @@ type MQSession struct {
MQConnection *amqp.Connection
MQChannel *amqp.Channel
MQQueue *amqp.Queue
MQDelivery <-chan *ampq.Delivery
MQDelivery <-chan *amqp.Delivery
isConnected bool
}

4
mq.go
View File

@ -8,13 +8,13 @@ import (
func (s MQSession) Open() error {
if s.isConnected {
return error.Error("Session is already connected.")
return errors.New("Session is already connected.")
}
if SLL == false {
s.MQConnection, err = amqp.Dial("amqp://" + Session.User + ":" + Session.Password + "@" + Session.Host + "/" + Session.Path)
} else {
return error.Error("SSL connection not implemented")
return errors.New("SSL connection not implemented")
}
logOnError(err, "Open : Failed to connect to RabbitMQ")
if err != nil {

View File

@ -9,7 +9,6 @@ import (
"strings"
"time"
"github.com/streadway/amqp"
tb "gopkg.in/tucnak/telebot.v2"
)