diff --git a/README.md b/README.md index 1d0d7a7..24b6798 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,13 @@ Supported by [Qvault](https://qvault.io) ## Motivation -[Streadway's AMQP](https://github.com/streadway/amqp) library is currently the most robust and well-supported Go client I'm aware of. It's a fantastic option and I recommend starting there and seeing if it fulfills your needs. Their project has made an effort to stay within the scope of the AMQP protocol, as such, no reconnection logic and few ease-of-use abstractions are provided. +[Streadway's AMQP](https://github.com/rabbitmq/amqp091-go) library is currently the most robust and well-supported Go client I'm aware of. It's a fantastic option and I recommend starting there and seeing if it fulfills your needs. Their project has made an effort to stay within the scope of the AMQP protocol, as such, no reconnection logic and few ease-of-use abstractions are provided. + +⚠️ **Update** + +The Core Team of RabbitMQ has resumed the maintenance on [rabbitmq/amqp091-go](https://github.com/rabbitmq/amqp091-go). + +### Goal The goal with `go-rabbitmq` is to still provide most all of the nitty-gritty functionality of AMQP, but to make it easier to work with via a higher-level API. Particularly: @@ -128,7 +134,7 @@ Submit an issue (above in the issues tab) ## Transient Dependencies -My goal is to keep dependencies limited to 1, [github.com/streadway/amqp](https://github.com/streadway/amqp). +My goal is to keep dependencies limited to 1, [github.com/rabbitmq/amqp091-go](https://github.com/rabbitmq/amqp091-go). ## 👏 Contributing diff --git a/channel.go b/channel.go index 58e40ad..6b93f47 100644 --- a/channel.go +++ b/channel.go @@ -5,7 +5,7 @@ import ( "sync" "time" - "github.com/streadway/amqp" + amqp "github.com/rabbitmq/amqp091-go" ) type channelManager struct { diff --git a/consume.go b/consume.go index d10f024..b882fc7 100644 --- a/consume.go +++ b/consume.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/streadway/amqp" + amqp "github.com/rabbitmq/amqp091-go" ) // Action is an action that occurs after processed this delivery diff --git a/examples/consumer/main.go b/examples/consumer/main.go index a0b19c1..8d503b2 100644 --- a/examples/consumer/main.go +++ b/examples/consumer/main.go @@ -3,7 +3,7 @@ package main import ( "log" - "github.com/streadway/amqp" + amqp "github.com/rabbitmq/amqp091-go" rabbitmq "github.com/wagslane/go-rabbitmq" ) diff --git a/examples/logger/main.go b/examples/logger/main.go index 1844112..9ebcfa1 100644 --- a/examples/logger/main.go +++ b/examples/logger/main.go @@ -3,7 +3,7 @@ package main import ( "log" - "github.com/streadway/amqp" + amqp "github.com/rabbitmq/amqp091-go" rabbitmq "github.com/wagslane/go-rabbitmq" ) diff --git a/examples/publisher/main.go b/examples/publisher/main.go index 7ac33b0..8339b6d 100644 --- a/examples/publisher/main.go +++ b/examples/publisher/main.go @@ -3,7 +3,7 @@ package main import ( "log" - "github.com/streadway/amqp" + amqp "github.com/rabbitmq/amqp091-go" rabbitmq "github.com/wagslane/go-rabbitmq" ) diff --git a/go.mod b/go.mod index 6b0147b..ab9741a 100644 --- a/go.mod +++ b/go.mod @@ -2,4 +2,4 @@ module github.com/wagslane/go-rabbitmq go 1.16 -require github.com/streadway/amqp v1.0.0 +require github.com/rabbitmq/amqp091-go v0.0.0-20210823000215-c428a6150891 diff --git a/go.sum b/go.sum index 75f2157..b073bc2 100644 --- a/go.sum +++ b/go.sum @@ -1,2 +1,2 @@ -github.com/streadway/amqp v1.0.0 h1:kuuDrUJFZL1QYL9hUNuCxNObNzB0bV/ZG5jV3RWAQgo= -github.com/streadway/amqp v1.0.0/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/rabbitmq/amqp091-go v0.0.0-20210823000215-c428a6150891 h1:13nv5f/LNJxNpvpYm/u0NqrlFebon342f9Xu9GpklKc= +github.com/rabbitmq/amqp091-go v0.0.0-20210823000215-c428a6150891/go.mod h1:ogQDLSOACsLPsIq0NpbtiifNZi2YOz0VTJ0kHRghqbM= diff --git a/publish.go b/publish.go index ee7cce3..faf85e2 100644 --- a/publish.go +++ b/publish.go @@ -4,7 +4,7 @@ import ( "fmt" "sync" - "github.com/streadway/amqp" + amqp "github.com/rabbitmq/amqp091-go" ) // DeliveryMode. Transient means higher throughput but messages will not be diff --git a/table.go b/table.go index a2ed084..1b351f4 100644 --- a/table.go +++ b/table.go @@ -1,6 +1,6 @@ package rabbitmq -import "github.com/streadway/amqp" +import amqp "github.com/rabbitmq/amqp091-go" // Table stores user supplied fields of the following types: // diff --git a/vendor/github.com/streadway/amqp/.gitignore b/vendor/github.com/rabbitmq/amqp091-go/.gitignore similarity index 100% rename from vendor/github.com/streadway/amqp/.gitignore rename to vendor/github.com/rabbitmq/amqp091-go/.gitignore diff --git a/vendor/github.com/streadway/amqp/.travis.yml b/vendor/github.com/rabbitmq/amqp091-go/.travis.yml similarity index 87% rename from vendor/github.com/streadway/amqp/.travis.yml rename to vendor/github.com/rabbitmq/amqp091-go/.travis.yml index 7eee262..720da80 100644 --- a/vendor/github.com/streadway/amqp/.travis.yml +++ b/vendor/github.com/rabbitmq/amqp091-go/.travis.yml @@ -1,10 +1,8 @@ language: go go: - - 1.10.x - - 1.11.x - - 1.12.x - - 1.13.x + - 1.17.x + - 1.16.x addons: apt: diff --git a/vendor/github.com/rabbitmq/amqp091-go/CODE_OF_CONDUCT.md b/vendor/github.com/rabbitmq/amqp091-go/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..24b5675 --- /dev/null +++ b/vendor/github.com/rabbitmq/amqp091-go/CODE_OF_CONDUCT.md @@ -0,0 +1,77 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in RabbitMQ Operator project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at oss-coc@vmware.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq + diff --git a/vendor/github.com/streadway/amqp/CONTRIBUTING.md b/vendor/github.com/rabbitmq/amqp091-go/CONTRIBUTING.md similarity index 86% rename from vendor/github.com/streadway/amqp/CONTRIBUTING.md rename to vendor/github.com/rabbitmq/amqp091-go/CONTRIBUTING.md index c87f3d7..75a32b7 100644 --- a/vendor/github.com/streadway/amqp/CONTRIBUTING.md +++ b/vendor/github.com/rabbitmq/amqp091-go/CONTRIBUTING.md @@ -1,4 +1,4 @@ -## Prequisites +## Prerequisites 1. Go: [https://golang.org/dl/](https://golang.org/dl/) 1. Golint `go get -u -v github.com/golang/lint/golint` @@ -7,7 +7,7 @@ The workflow is pretty standard: -1. Fork github.com/streadway/amqp +1. Fork this repository, **github.com/rabbitmq/amqp091-go** 1. Add the pre-commit hook: `ln -s ../../pre-commit .git/hooks/pre-commit` 1. Create your feature branch (`git checkout -b my-new-feature`) 1. Run integration tests (see below) @@ -28,7 +28,9 @@ The test suite assumes that: After starting a local RabbitMQ, run integration tests with the following: - env AMQP_URL=amqp://guest:guest@127.0.0.1:5672/ go test -v -cpu 2 -tags integration -race +``` shell +env AMQP_URL=amqp://guest:guest@127.0.0.1:5672/ go test -v -tags integration +``` All integration tests should use the `integrationConnection(...)` test helpers defined in `integration_test.go` to setup the integration environment diff --git a/vendor/github.com/streadway/amqp/LICENSE b/vendor/github.com/rabbitmq/amqp091-go/LICENSE similarity index 89% rename from vendor/github.com/streadway/amqp/LICENSE rename to vendor/github.com/rabbitmq/amqp091-go/LICENSE index 07b8968..72fa55e 100644 --- a/vendor/github.com/streadway/amqp/LICENSE +++ b/vendor/github.com/rabbitmq/amqp091-go/LICENSE @@ -1,5 +1,7 @@ -Copyright (c) 2012-2019, Sean Treadway, SoundCloud Ltd. -All rights reserved. +AMQP 0-9-1 Go Client +Copyright (c) 2021 VMware, Inc. or its affiliates. All Rights Reserved. + +Copyright (c) 2012-2021, Sean Treadway, SoundCloud Ltd. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/vendor/github.com/rabbitmq/amqp091-go/Makefile b/vendor/github.com/rabbitmq/amqp091-go/Makefile new file mode 100644 index 0000000..b2ab895 --- /dev/null +++ b/vendor/github.com/rabbitmq/amqp091-go/Makefile @@ -0,0 +1,17 @@ +.DEFAULT_GOAL := list + +# Insert a comment starting with '##' after a target, and it will be printed by 'make' and 'make list' +list: ## list Makefile targets + @echo "The most used targets: \n" + @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' + + +fmt: ## Run go fmt against code + go fmt ./... + + +vet: ## Run go vet against code + go vet ./... + +tests: ## Run all tests and requires a running rabbitmq-server + env AMQP_URL=amqp://guest:guest@127.0.0.1:5672/ go test -v -tags integration diff --git a/vendor/github.com/streadway/amqp/README.md b/vendor/github.com/rabbitmq/amqp091-go/README.md similarity index 59% rename from vendor/github.com/streadway/amqp/README.md rename to vendor/github.com/rabbitmq/amqp091-go/README.md index 287830b..85e0491 100644 --- a/vendor/github.com/streadway/amqp/README.md +++ b/vendor/github.com/rabbitmq/amqp091-go/README.md @@ -1,33 +1,58 @@ -[![Build Status](https://api.travis-ci.org/streadway/amqp.svg)](http://travis-ci.org/streadway/amqp) [![GoDoc](https://godoc.org/github.com/streadway/amqp?status.svg)](http://godoc.org/github.com/streadway/amqp) - # Go RabbitMQ Client Library -This is an AMQP 0.9.1 client with RabbitMQ extensions in Go. +This is a Go AMQP 0.9.1 client maintained by the [RabbitMQ core team](https://github.com/rabbitmq). +It was [originally developed by Sean Treadway](https://github.com/streadway/amqp). + +## Differences from streadway/amqp + +Some things are different compared to the original client, +others haven't changed. + +### Package Name + +This library uses a different package name. If moving from `streadway/amqp`, +using an alias may reduce the number of changes needed: + +``` go +amqp "github.com/rabbitmq/amqp091-go" +``` + +### License + +This client uses the same 2-clause BSD license as the original project. + +### Public API Evolution + + This client retains key API elements as practically possible. + It is, however, open to reasonable breaking public API changes suggested by the community. + We don't have the "no breaking public API changes ever" rule and fully recognize + that a good client API evolves over time. + ## Project Maturity -This project has been used in production systems for many years. It is reasonably mature -and feature complete, and as of November 2016 has [a team of maintainers](https://github.com/streadway/amqp/issues/215). +This project is based on a mature Go client that's been around for over a decade. + +We expect this client to undergo moderate breaking public API changes in 2021. +Major and minor versions will be updated accordingly. -Future API changes are unlikely but possible. They will be discussed on [Github -issues](https://github.com/streadway/amqp/issues) along with any bugs or -enhancements. ## Supported Go Versions -This library supports two most recent Go release series, currently 1.10 and 1.11. +This client supports two most recent Go release series. ## Supported RabbitMQ Versions This project supports RabbitMQ versions starting with `2.0` but primarily tested -against reasonably recent `3.x` releases. Some features and behaviours may be -server version-specific. +against [currently supported RabbitMQ release series](https://www.rabbitmq.com/versions.html). + +Some features and behaviours may be server version-specific. ## Goals Provide a functional interface that closely represents the AMQP 0.9.1 model -targeted to RabbitMQ as a server. This includes the minimum necessary to +targeted to RabbitMQ as a server. This includes the minimum necessary to interact the semantics of the protocol. ## Non-goals @@ -62,30 +87,20 @@ please file an issue. ## Documentation -Use [Godoc documentation](http://godoc.org/github.com/streadway/amqp) for -reference and usage. - -[RabbitMQ tutorials in -Go](https://github.com/rabbitmq/rabbitmq-tutorials/tree/master/go) are also -available. + * [Godoc API reference](http://godoc.org/github.com/rabbitmq/amqp091-go) + * [RabbitMQ tutorials in Go](https://github.com/rabbitmq/rabbitmq-tutorials/tree/master/go) currently use a different client. + They will be switched to use this client eventually ## Contributing -Pull requests are very much welcomed. Create your pull request on a non-master -branch, make sure a test or example is included that covers your change and +Pull requests are very much welcomed. Create your pull request on a non-main +branch, make sure a test or example is included that covers your change, and your commits represent coherent changes that include a reason for the change. To run the integration tests, make sure you have RabbitMQ running on any host, export the environment variable `AMQP_URL=amqp://host/` and run `go test -tags integration`. TravisCI will also run the integration tests. -Thanks to the [community of contributors](https://github.com/streadway/amqp/graphs/contributors). - -## External packages - - * [Google App Engine Dialer support](https://github.com/soundtrackyourbrand/gaeamqp) - * [RabbitMQ examples in Go](https://github.com/rabbitmq/rabbitmq-tutorials/tree/master/go) - ## License BSD 2 clause - see LICENSE for more details. diff --git a/vendor/github.com/streadway/amqp/allocator.go b/vendor/github.com/rabbitmq/amqp091-go/allocator.go similarity index 99% rename from vendor/github.com/streadway/amqp/allocator.go rename to vendor/github.com/rabbitmq/amqp091-go/allocator.go index 53620e7..d85614a 100644 --- a/vendor/github.com/streadway/amqp/allocator.go +++ b/vendor/github.com/rabbitmq/amqp091-go/allocator.go @@ -1,4 +1,4 @@ -package amqp +package amqp091 import ( "bytes" diff --git a/vendor/github.com/streadway/amqp/auth.go b/vendor/github.com/rabbitmq/amqp091-go/auth.go similarity index 91% rename from vendor/github.com/streadway/amqp/auth.go rename to vendor/github.com/rabbitmq/amqp091-go/auth.go index 435c94b..f283d34 100644 --- a/vendor/github.com/streadway/amqp/auth.go +++ b/vendor/github.com/rabbitmq/amqp091-go/auth.go @@ -1,9 +1,8 @@ -// Copyright (c) 2012, Sean Treadway, SoundCloud Ltd. +// Copyright (c) 2021 VMware, Inc. or its affiliates. All Rights Reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Source code and contact info at http://github.com/streadway/amqp -package amqp +package amqp091 import ( "fmt" diff --git a/vendor/github.com/streadway/amqp/certs.sh b/vendor/github.com/rabbitmq/amqp091-go/certs.sh similarity index 100% rename from vendor/github.com/streadway/amqp/certs.sh rename to vendor/github.com/rabbitmq/amqp091-go/certs.sh diff --git a/vendor/github.com/streadway/amqp/channel.go b/vendor/github.com/rabbitmq/amqp091-go/channel.go similarity index 99% rename from vendor/github.com/streadway/amqp/channel.go rename to vendor/github.com/rabbitmq/amqp091-go/channel.go index cd19ce7..c54d5a0 100644 --- a/vendor/github.com/streadway/amqp/channel.go +++ b/vendor/github.com/rabbitmq/amqp091-go/channel.go @@ -1,9 +1,8 @@ -// Copyright (c) 2012, Sean Treadway, SoundCloud Ltd. +// Copyright (c) 2021 VMware, Inc. or its affiliates. All Rights Reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Source code and contact info at http://github.com/streadway/amqp -package amqp +package amqp091 import ( "reflect" @@ -433,6 +432,12 @@ func (ch *Channel) Close() error { ) } +// IsClosed returns true if the channel is marked as closed, otherwise false +// is returned. +func (ch *Channel) IsClosed() bool { + return atomic.LoadInt32(&ch.closed) == 1 +} + /* NotifyClose registers a listener for when the server sends a channel or connection exception in the form of a Connection.Close or Channel.Close method. @@ -1082,7 +1087,7 @@ func (ch *Channel) Consume(queue, consumer string, autoAck, exclusive, noLocal, return nil, err } - return (<-chan Delivery)(deliveries), nil + return deliveries, nil } /* diff --git a/vendor/github.com/streadway/amqp/confirms.go b/vendor/github.com/rabbitmq/amqp091-go/confirms.go similarity index 90% rename from vendor/github.com/streadway/amqp/confirms.go rename to vendor/github.com/rabbitmq/amqp091-go/confirms.go index 06cbaa7..42450f4 100644 --- a/vendor/github.com/streadway/amqp/confirms.go +++ b/vendor/github.com/rabbitmq/amqp091-go/confirms.go @@ -1,4 +1,4 @@ -package amqp +package amqp091 import "sync" @@ -27,7 +27,7 @@ func (c *confirms) Listen(l chan Confirmation) { c.listeners = append(c.listeners, l) } -// publish increments the publishing counter +// Publish increments the publishing counter func (c *confirms) Publish() uint64 { c.m.Lock() defer c.m.Unlock() @@ -57,7 +57,7 @@ func (c *confirms) resequence() { } } -// one confirms one publishing and all following in the publishing sequence +// One confirms one publishing and all following in the publishing sequence func (c *confirms) One(confirmed Confirmation) { c.m.Lock() defer c.m.Unlock() @@ -70,7 +70,7 @@ func (c *confirms) One(confirmed Confirmation) { c.resequence() } -// multiple confirms all publishings up until the delivery tag +// Multiple confirms all publishings up until the delivery tag func (c *confirms) Multiple(confirmed Confirmation) { c.m.Lock() defer c.m.Unlock() diff --git a/vendor/github.com/streadway/amqp/connection.go b/vendor/github.com/rabbitmq/amqp091-go/connection.go similarity index 98% rename from vendor/github.com/streadway/amqp/connection.go rename to vendor/github.com/rabbitmq/amqp091-go/connection.go index b9d8e8e..a967ec4 100644 --- a/vendor/github.com/streadway/amqp/connection.go +++ b/vendor/github.com/rabbitmq/amqp091-go/connection.go @@ -1,9 +1,8 @@ -// Copyright (c) 2012, Sean Treadway, SoundCloud Ltd. +// Copyright (c) 2021 VMware, Inc. or its affiliates. All Rights Reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Source code and contact info at http://github.com/streadway/amqp -package amqp +package amqp091 import ( "bufio" @@ -528,7 +527,12 @@ func (c *Connection) reader(r io.Reader) { c.demux(frame) if haveDeadliner { - c.deadlines <- conn + select { + case c.deadlines <- conn: + default: + // On c.Close() c.heartbeater() might exit just before c.deadlines <- conn is called. + // Which results in this goroutine being stuck forever. + } } } } @@ -712,7 +716,7 @@ func (c *Connection) openStart(config Config) error { c.Major = int(start.VersionMajor) c.Minor = int(start.VersionMinor) - c.Properties = Table(start.ServerProperties) + c.Properties = start.ServerProperties c.Locales = strings.Split(start.Locales, " ") // eventually support challenge/response here by also responding to @@ -779,7 +783,7 @@ func (c *Connection) openTune(config Config, auth Authentication) error { // "The client should start sending heartbeats after receiving a // Connection.Tune method" - go c.heartbeater(c.Config.Heartbeat, c.NotifyClose(make(chan *Error, 1))) + go c.heartbeater(c.Config.Heartbeat/2, c.NotifyClose(make(chan *Error, 1))) if err := c.send(&methodFrame{ ChannelId: 0, diff --git a/vendor/github.com/streadway/amqp/consumers.go b/vendor/github.com/rabbitmq/amqp091-go/consumers.go similarity index 95% rename from vendor/github.com/streadway/amqp/consumers.go rename to vendor/github.com/rabbitmq/amqp091-go/consumers.go index 887ac74..dfd0380 100644 --- a/vendor/github.com/streadway/amqp/consumers.go +++ b/vendor/github.com/rabbitmq/amqp091-go/consumers.go @@ -1,9 +1,8 @@ -// Copyright (c) 2012, Sean Treadway, SoundCloud Ltd. +// Copyright (c) 2021 VMware, Inc. or its affiliates. All Rights Reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Source code and contact info at http://github.com/streadway/amqp -package amqp +package amqp091 import ( "os" diff --git a/vendor/github.com/streadway/amqp/delivery.go b/vendor/github.com/rabbitmq/amqp091-go/delivery.go similarity index 96% rename from vendor/github.com/streadway/amqp/delivery.go rename to vendor/github.com/rabbitmq/amqp091-go/delivery.go index 7241264..84d9da5 100644 --- a/vendor/github.com/streadway/amqp/delivery.go +++ b/vendor/github.com/rabbitmq/amqp091-go/delivery.go @@ -1,9 +1,8 @@ -// Copyright (c) 2012, Sean Treadway, SoundCloud Ltd. +// Copyright (c) 2021 VMware, Inc. or its affiliates. All Rights Reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Source code and contact info at http://github.com/streadway/amqp -package amqp +package amqp091 import ( "errors" @@ -13,7 +12,7 @@ import ( var errDeliveryNotInitialized = errors.New("delivery not initialized") // Acknowledger notifies the server of successful or failed consumption of -// delivieries via identifier found in the Delivery.DeliveryTag field. +// deliveries via identifier found in the Delivery.DeliveryTag field. // // Applications can provide mock implementations in tests of Delivery handlers. type Acknowledger interface { diff --git a/vendor/github.com/streadway/amqp/doc.go b/vendor/github.com/rabbitmq/amqp091-go/doc.go similarity index 93% rename from vendor/github.com/streadway/amqp/doc.go rename to vendor/github.com/rabbitmq/amqp091-go/doc.go index d544e0a..b9ecbb6 100644 --- a/vendor/github.com/streadway/amqp/doc.go +++ b/vendor/github.com/rabbitmq/amqp091-go/doc.go @@ -1,13 +1,12 @@ -// Copyright (c) 2012, Sean Treadway, SoundCloud Ltd. +// Copyright (c) 2021 VMware, Inc. or its affiliates. All Rights Reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Source code and contact info at http://github.com/streadway/amqp /* -Package amqp is an AMQP 0.9.1 client with RabbitMQ extensions +Package amqp091 is an AMQP 0.9.1 client with RabbitMQ extensions Understand the AMQP 0.9.1 messaging model by reviewing these links first. Much -of the terminoLoggery in this library directly relates to AMQP concepts. +of the terminology in this library directly relates to AMQP concepts. Resources @@ -59,7 +58,7 @@ of band from an RPC call like basic.ack or basic.flow. Any asynchronous events, including Deliveries and Publishings must always have a receiver until the corresponding chans are closed. Without asynchronous -receivers, the sychronous methods will block. +receivers, the synchronous methods will block. Use Case @@ -105,4 +104,4 @@ encounters an amqp:// scheme. SSL/TLS in RabbitMQ is documented here: http://www.rabbitmq.com/ssl.html */ -package amqp +package amqp091 diff --git a/vendor/github.com/streadway/amqp/fuzz.go b/vendor/github.com/rabbitmq/amqp091-go/fuzz.go similarity index 93% rename from vendor/github.com/streadway/amqp/fuzz.go rename to vendor/github.com/rabbitmq/amqp091-go/fuzz.go index 16e626c..ed55ad4 100644 --- a/vendor/github.com/streadway/amqp/fuzz.go +++ b/vendor/github.com/rabbitmq/amqp091-go/fuzz.go @@ -1,6 +1,6 @@ // +build gofuzz -package amqp +package amqp091 import "bytes" diff --git a/vendor/github.com/streadway/amqp/gen.sh b/vendor/github.com/rabbitmq/amqp091-go/gen.sh similarity index 100% rename from vendor/github.com/streadway/amqp/gen.sh rename to vendor/github.com/rabbitmq/amqp091-go/gen.sh diff --git a/vendor/github.com/rabbitmq/amqp091-go/go.mod b/vendor/github.com/rabbitmq/amqp091-go/go.mod new file mode 100644 index 0000000..978d286 --- /dev/null +++ b/vendor/github.com/rabbitmq/amqp091-go/go.mod @@ -0,0 +1,3 @@ +module github.com/rabbitmq/amqp091-go + +go 1.15 diff --git a/vendor/github.com/streadway/amqp/pre-commit b/vendor/github.com/rabbitmq/amqp091-go/pre-commit similarity index 100% rename from vendor/github.com/streadway/amqp/pre-commit rename to vendor/github.com/rabbitmq/amqp091-go/pre-commit diff --git a/vendor/github.com/streadway/amqp/read.go b/vendor/github.com/rabbitmq/amqp091-go/read.go similarity index 97% rename from vendor/github.com/streadway/amqp/read.go rename to vendor/github.com/rabbitmq/amqp091-go/read.go index 3aa0b33..e9f7253 100644 --- a/vendor/github.com/streadway/amqp/read.go +++ b/vendor/github.com/rabbitmq/amqp091-go/read.go @@ -1,9 +1,8 @@ -// Copyright (c) 2012, Sean Treadway, SoundCloud Ltd. +// Copyright (c) 2021 VMware, Inc. or its affiliates. All Rights Reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Source code and contact info at http://github.com/streadway/amqp -package amqp +package amqp091 import ( "bytes" @@ -14,7 +13,7 @@ import ( ) /* -Reads a frame from an input stream and returns an interface that can be cast into +ReadFrame reads a frame from an input stream and returns an interface that can be cast into one of the following: methodFrame @@ -50,7 +49,7 @@ func (r *reader) ReadFrame() (frame frame, err error) { return } - typ := uint8(scratch[0]) + typ := scratch[0] channel := binary.BigEndian.Uint16(scratch[1:3]) size := binary.BigEndian.Uint32(scratch[3:7]) @@ -309,7 +308,7 @@ func readArray(r io.Reader) ([]interface{}, error) { var ( lim = &io.LimitedReader{R: r, N: int64(size)} - arr = []interface{}{} + arr []interface{} field interface{} ) diff --git a/vendor/github.com/streadway/amqp/return.go b/vendor/github.com/rabbitmq/amqp091-go/return.go similarity index 94% rename from vendor/github.com/streadway/amqp/return.go rename to vendor/github.com/rabbitmq/amqp091-go/return.go index 10dcedb..5816f3a 100644 --- a/vendor/github.com/streadway/amqp/return.go +++ b/vendor/github.com/rabbitmq/amqp091-go/return.go @@ -1,9 +1,8 @@ -// Copyright (c) 2012, Sean Treadway, SoundCloud Ltd. +// Copyright (c) 2021 VMware, Inc. or its affiliates. All Rights Reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Source code and contact info at http://github.com/streadway/amqp -package amqp +package amqp091 import ( "time" diff --git a/vendor/github.com/streadway/amqp/spec091.go b/vendor/github.com/rabbitmq/amqp091-go/spec091.go similarity index 99% rename from vendor/github.com/streadway/amqp/spec091.go rename to vendor/github.com/rabbitmq/amqp091-go/spec091.go index cd53ebe..cfcdf1c 100644 --- a/vendor/github.com/streadway/amqp/spec091.go +++ b/vendor/github.com/rabbitmq/amqp091-go/spec091.go @@ -1,12 +1,11 @@ -// Copyright (c) 2012, Sean Treadway, SoundCloud Ltd. +// Copyright (c) 2021 VMware, Inc. or its affiliates. All Rights Reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Source code and contact info at http://github.com/streadway/amqp /* GENERATED FILE - DO NOT EDIT */ /* Rebuild from the spec/gen.go tool */ -package amqp +package amqp091 import ( "encoding/binary" diff --git a/vendor/github.com/streadway/amqp/types.go b/vendor/github.com/rabbitmq/amqp091-go/types.go similarity index 98% rename from vendor/github.com/streadway/amqp/types.go rename to vendor/github.com/rabbitmq/amqp091-go/types.go index 83bd92f..3875f7e 100644 --- a/vendor/github.com/streadway/amqp/types.go +++ b/vendor/github.com/rabbitmq/amqp091-go/types.go @@ -1,9 +1,8 @@ -// Copyright (c) 2012, Sean Treadway, SoundCloud Ltd. +// Copyright (c) 2021 VMware, Inc. or its affiliates. All Rights Reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Source code and contact info at http://github.com/streadway/amqp -package amqp +package amqp091 import ( "fmt" @@ -29,7 +28,7 @@ var ( ErrChannelMax = &Error{Code: ChannelError, Reason: "channel id space exhausted"} // ErrSASL is returned from Dial when the authentication mechanism could not - // be negoated. + // be negotiated. ErrSASL = &Error{Code: AccessRefused, Reason: "SASL could not negotiate a shared mechanism"} // ErrCredentials is returned when the authenticated client is not authorized diff --git a/vendor/github.com/streadway/amqp/uri.go b/vendor/github.com/rabbitmq/amqp091-go/uri.go similarity index 96% rename from vendor/github.com/streadway/amqp/uri.go rename to vendor/github.com/rabbitmq/amqp091-go/uri.go index e584715..73e29bc 100644 --- a/vendor/github.com/streadway/amqp/uri.go +++ b/vendor/github.com/rabbitmq/amqp091-go/uri.go @@ -1,9 +1,8 @@ -// Copyright (c) 2012, Sean Treadway, SoundCloud Ltd. +// Copyright (c) 2021 VMware, Inc. or its affiliates. All Rights Reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Source code and contact info at http://github.com/streadway/amqp -package amqp +package amqp091 import ( "errors" diff --git a/vendor/github.com/streadway/amqp/write.go b/vendor/github.com/rabbitmq/amqp091-go/write.go similarity index 97% rename from vendor/github.com/streadway/amqp/write.go rename to vendor/github.com/rabbitmq/amqp091-go/write.go index 94a46d1..936a021 100644 --- a/vendor/github.com/streadway/amqp/write.go +++ b/vendor/github.com/rabbitmq/amqp091-go/write.go @@ -1,9 +1,8 @@ -// Copyright (c) 2012, Sean Treadway, SoundCloud Ltd. +// Copyright (c) 2021 VMware, Inc. or its affiliates. All Rights Reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Source code and contact info at http://github.com/streadway/amqp -package amqp +package amqp091 import ( "bufio" @@ -212,7 +211,7 @@ func writeFrame(w io.Writer, typ uint8, channel uint16, payload []byte) (err err size := uint(len(payload)) _, err = w.Write([]byte{ - byte(typ), + typ, byte((channel & 0xff00) >> 8), byte((channel & 0x00ff) >> 0), byte((size & 0xff000000) >> 24), @@ -300,7 +299,7 @@ func writeField(w io.Writer, value interface{}) (err error) { case byte: buf[0] = 'b' - buf[1] = byte(v) + buf[1] = v enc = buf[:2] case int16: @@ -335,7 +334,7 @@ func writeField(w io.Writer, value interface{}) (err error) { case Decimal: buf[0] = 'D' - buf[1] = byte(v.Scale) + buf[1] = v.Scale binary.BigEndian.PutUint32(buf[2:6], uint32(v.Value)) enc = buf[:6] diff --git a/vendor/github.com/streadway/amqp/go.mod b/vendor/github.com/streadway/amqp/go.mod deleted file mode 100644 index 4eeab33..0000000 --- a/vendor/github.com/streadway/amqp/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module github.com/streadway/amqp - -go 1.10 diff --git a/vendor/modules.txt b/vendor/modules.txt index 0dc2eda..802a23c 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,3 +1,3 @@ -# github.com/streadway/amqp v1.0.0 +# github.com/rabbitmq/amqp091-go v0.0.0-20210823000215-c428a6150891 ## explicit -github.com/streadway/amqp +github.com/rabbitmq/amqp091-go