Skip to content

update package streadway/amqp to rabbitmq/amqp091-go #38

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,4 @@ Temporary Items
### INTELLIJ IDEA ###
.idea/
*.iml
/vendor
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Cony

High-level AMQP 0.9.1 client library. It's wrapper around low-level [streadway/amqp](https://github.com/streadway/amqp/) library.
High-level AMQP 0.9.1 client library. It's wrapper around low-level [rabbitmq/amqp091-go](https://github.com/rabbitmq/amqp091-go/) library.
This is a fork from github.com/assembla/cony to change from deprecated [streadway/amqp](https://github.com/streadway/amqp/) library.

# Goals

Expand Down
5 changes: 2 additions & 3 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ package cony

import (
"errors"
amqp "github.com/rabbitmq/amqp091-go"
"sync"
"sync/atomic"
"time"

"github.com/streadway/amqp"
)

const (
Expand All @@ -32,7 +31,7 @@ type Client struct {
errs chan error
blocking chan amqp.Blocking
run int32 // bool
conn atomic.Value //*amqp.Connection
conn atomic.Value // *amqp.Connection
bo Backoffer
attempt int32
l sync.Mutex
Expand Down
2 changes: 1 addition & 1 deletion client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"errors"
"testing"

"github.com/streadway/amqp"
amqp "github.com/rabbitmq/amqp091-go"
)

func TestNewClient(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"
"sync"

"github.com/streadway/amqp"
amqp "github.com/rabbitmq/amqp091-go"
)

// ConsumerOpt is a consumer's functional option type
Expand Down
2 changes: 1 addition & 1 deletion consumer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"testing"
"time"

"github.com/streadway/amqp"
amqp "github.com/rabbitmq/amqp091-go"
)

func TestAutoAck(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion cony.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package cony
import (
"sync"

"github.com/streadway/amqp"
amqp "github.com/rabbitmq/amqp091-go"
)

// Queue hold definition of AMQP queue
Expand Down
2 changes: 1 addition & 1 deletion cony_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package cony

import "github.com/streadway/amqp"
import amqp "github.com/rabbitmq/amqp091-go"

type mqDeleterTest struct {
_deletePublisher func(*Publisher)
Expand Down
2 changes: 1 addition & 1 deletion declaration.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package cony

import "github.com/streadway/amqp"
import amqp "github.com/rabbitmq/amqp091-go"

// Declaration is a callback type to declare AMQP queue/exchange/binding
type Declaration func(Declarer) error
Expand Down
2 changes: 1 addition & 1 deletion declaration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package cony
import (
"testing"

"github.com/streadway/amqp"
amqp "github.com/rabbitmq/amqp091-go"
)

type testDeclarer struct {
Expand Down
2 changes: 1 addition & 1 deletion doc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"time"

"github.com/assembla/cony"
"github.com/streadway/amqp"
amqp "github.com/rabbitmq/amqp091-go"
)

func Example() {
Expand Down
2 changes: 1 addition & 1 deletion examples/basic/producer/producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"

"github.com/assembla/cony"
"github.com/streadway/amqp"
amqp "github.com/rabbitmq/amqp091-go"
"time"
)

Expand Down
2 changes: 1 addition & 1 deletion examples/email/producer/producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"net/http"

"github.com/assembla/cony"
"github.com/streadway/amqp"
amqp "github.com/rabbitmq/amqp091-go"
)

var port = flag.Int("port", 3000, "listening port")
Expand Down
2 changes: 1 addition & 1 deletion examples/web/producer/producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"net/http"

"github.com/assembla/cony"
"github.com/streadway/amqp"
amqp "github.com/rabbitmq/amqp091-go"
)

var port = flag.Int("port", 3000, "listening port")
Expand Down
5 changes: 5 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module github.com/assembla/cony

go 1.19

require github.com/rabbitmq/amqp091-go v1.9.0
18 changes: 18 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rabbitmq/amqp091-go v1.9.0 h1:qrQtyzB4H8BQgEuJwhmVQqVHB9O4+MNDJCCAcpc3Aoo=
github.com/rabbitmq/amqp091-go v1.9.0/go.mod h1:+jPrT9iY2eLjRaMSRHUhc3z14E/l85kv/f+6luSD3pc=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A=
go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
2 changes: 1 addition & 1 deletion publisher.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"errors"
"sync"

"github.com/streadway/amqp"
amqp "github.com/rabbitmq/amqp091-go"
)

// ErrPublisherDead indicates that publisher was canceled, could be returned
Expand Down
2 changes: 1 addition & 1 deletion publisher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"io"
"testing"

"github.com/streadway/amqp"
amqp "github.com/rabbitmq/amqp091-go"
)

func TestPublisherImplements_io_Writer(t *testing.T) {
Expand Down