diff --git a/README.md b/README.md index 9fa0dc0..f937e5b 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ Go language implementation of a STOMP client library. [![Build Status](https://travis-ci.org/go-stomp/stomp.svg?branch=master)](https://travis-ci.org/go-stomp/stomp) +[![Go Reference](https://pkg.go.dev/badge/github.com/go-stomp/stomp/v3.svg)](https://pkg.go.dev/github.com/go-stomp/stomp/v3) Features: @@ -14,27 +15,16 @@ Features: ## Usage Instructions ``` -go get github.com/go-stomp/stomp +go get github.com/go-stomp/stomp/v3 ``` -For API documentation, see http://godoc.org/github.com/go-stomp/stomp +For API documentation, see https://pkg.go.dev/github.com/go-stomp/stomp/v3 -## Previous Version - -An earlier version of this package made use of Gustavo Niemeyer's gopkg.in facility -for versioning Go libraries. This earlier version of the library is still available: - -``` -go get gopkg.in/stomp.v1 -``` - -API documentation for this earlier version can be found at http://gopkg.in/stomp.v1 Breaking changes between this previous version and the current version are documented in [breaking_changes.md](breaking_changes.md). - ## License Copyright 2012 - Present The go-stomp authors diff --git a/ack.go b/ack.go index 1d5a463..ede59c0 100644 --- a/ack.go +++ b/ack.go @@ -1,7 +1,7 @@ package stomp import ( - "github.com/go-stomp/stomp/frame" + "github.com/go-stomp/stomp/v3/frame" ) // The AckMode type is an enumeration of the acknowledgement modes for a diff --git a/breaking_changes.md b/breaking_changes.md index 992175a..b60209f 100644 --- a/breaking_changes.md +++ b/breaking_changes.md @@ -3,7 +3,25 @@ This document provides a list of breaking changes since the V1 release of the stomp client library. -## 1. No longer using gopkg.in +## v2 and v3 + +### Module support + +Version 2 was released before module support was present in golang, and changes were tagged wit that version. +Therefore we had to update again the import path. + +The API it's stable the only breaking change is the import path. + +Version 3: +```go +import ( + "github.com/go-stomp/stomp/v3" +) +``` + +## v1 and v2 + +### 1. No longer using gopkg.in Version 1 of the library used Gustavo Niemeyer's `gopkg.in` facility for versioning Go libraries. For a number of reasons, the `stomp` library no longer uses this facility. For this reason the @@ -23,7 +41,7 @@ import ( ) ``` -## 2. Frame types moved to frame package +### 2. Frame types moved to frame package Version 1 of the library included a number of types to do with STOMP frames in the `stomp` package, and the `frame` package consisted of just a few constant definitions. @@ -41,7 +59,7 @@ This change was considered worthwhile for the following reasons: * Ideally, users of the `stomp` package do not need to directly reference the items in the `frame` package, and the types moved are not needed in normal usage of the `stomp` package. -## 3. Use of functional options +### 3. Use of functional options Version 2 of the stomp library makes use of functional options to provide a clean, flexible way of specifying options in the following API calls: diff --git a/conn.go b/conn.go index e92a520..075ffd9 100644 --- a/conn.go +++ b/conn.go @@ -9,7 +9,7 @@ import ( "sync" "time" - "github.com/go-stomp/stomp/frame" + "github.com/go-stomp/stomp/v3/frame" ) // Default time span to add to read/write heart-beat timeouts diff --git a/conn_options.go b/conn_options.go index 6252f2e..8a64864 100644 --- a/conn_options.go +++ b/conn_options.go @@ -5,7 +5,7 @@ import ( "strings" "time" - "github.com/go-stomp/stomp/frame" + "github.com/go-stomp/stomp/v3/frame" ) // ConnOptions is an opaque structure used to collection options diff --git a/conn_test.go b/conn_test.go index 646d557..71733c7 100644 --- a/conn_test.go +++ b/conn_test.go @@ -5,8 +5,8 @@ import ( "io" "time" - "github.com/go-stomp/stomp/frame" - "github.com/go-stomp/stomp/testutil" + "github.com/go-stomp/stomp/v3/frame" + "github.com/go-stomp/stomp/v3/testutil" . "gopkg.in/check.v1" ) diff --git a/errors.go b/errors.go index bb9b312..e078ceb 100644 --- a/errors.go +++ b/errors.go @@ -1,7 +1,7 @@ package stomp import ( - "github.com/go-stomp/stomp/frame" + "github.com/go-stomp/stomp/v3/frame" ) // Error values diff --git a/example_test.go b/example_test.go index ddec1ca..4f095d9 100644 --- a/example_test.go +++ b/example_test.go @@ -5,8 +5,8 @@ import ( "net" "time" - "github.com/go-stomp/stomp" - "github.com/go-stomp/stomp/frame" + "github.com/go-stomp/stomp/v3" + "github.com/go-stomp/stomp/v3/frame" ) func ExampleConn_Send(c *stomp.Conn) error { diff --git a/examples/client_test/main.go b/examples/client_test/main.go index 192e3fd..7fd61c8 100644 --- a/examples/client_test/main.go +++ b/examples/client_test/main.go @@ -5,7 +5,7 @@ import ( "fmt" "os" - "github.com/go-stomp/stomp" + "github.com/go-stomp/stomp/v3" ) const defaultPort = ":61613" diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..f8cabe8 --- /dev/null +++ b/go.mod @@ -0,0 +1,5 @@ +module github.com/go-stomp/stomp/v3 + +go 1.15 + +require gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..0c3aa11 --- /dev/null +++ b/go.sum @@ -0,0 +1,7 @@ +github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= diff --git a/message.go b/message.go index bc68fff..e53f042 100644 --- a/message.go +++ b/message.go @@ -2,7 +2,7 @@ package stomp import ( "io" - "github.com/go-stomp/stomp/frame" + "github.com/go-stomp/stomp/v3/frame" ) // A Message represents a message received from the STOMP server. diff --git a/send_options.go b/send_options.go index 4a6a386..bd81b00 100644 --- a/send_options.go +++ b/send_options.go @@ -1,7 +1,7 @@ package stomp import ( - "github.com/go-stomp/stomp/frame" + "github.com/go-stomp/stomp/v3/frame" ) // SendOpt contains options for for the Conn.Send and Transaction.Send functions. diff --git a/server/client/conn.go b/server/client/conn.go index a80c380..87f1b6b 100644 --- a/server/client/conn.go +++ b/server/client/conn.go @@ -8,8 +8,8 @@ import ( "strconv" "time" - "github.com/go-stomp/stomp" - "github.com/go-stomp/stomp/frame" + "github.com/go-stomp/stomp/v3" + "github.com/go-stomp/stomp/v3/frame" ) // Maximum number of pending frames allowed to a client. diff --git a/server/client/frame.go b/server/client/frame.go index 79750b7..ce967b6 100644 --- a/server/client/frame.go +++ b/server/client/frame.go @@ -6,8 +6,8 @@ import ( "strconv" "strings" - "github.com/go-stomp/stomp" - "github.com/go-stomp/stomp/frame" + "github.com/go-stomp/stomp/v3" + "github.com/go-stomp/stomp/v3/frame" ) const ( diff --git a/server/client/frame_test.go b/server/client/frame_test.go index a26afa5..508e6cb 100644 --- a/server/client/frame_test.go +++ b/server/client/frame_test.go @@ -1,8 +1,8 @@ package client import ( - "github.com/go-stomp/stomp" - "github.com/go-stomp/stomp/frame" + "github.com/go-stomp/stomp/v3" + "github.com/go-stomp/stomp/v3/frame" . "gopkg.in/check.v1" ) diff --git a/server/client/request.go b/server/client/request.go index 4db6303..3b6aa40 100644 --- a/server/client/request.go +++ b/server/client/request.go @@ -3,7 +3,7 @@ package client import ( "strconv" - "github.com/go-stomp/stomp/frame" + "github.com/go-stomp/stomp/v3/frame" ) // Opcode used in client requests. diff --git a/server/client/subscription.go b/server/client/subscription.go index 2cdd8c3..a9f1757 100644 --- a/server/client/subscription.go +++ b/server/client/subscription.go @@ -1,7 +1,7 @@ package client import ( - "github.com/go-stomp/stomp/frame" + "github.com/go-stomp/stomp/v3/frame" ) type Subscription struct { diff --git a/server/client/tx_store.go b/server/client/tx_store.go index e7ce13a..d2c4354 100644 --- a/server/client/tx_store.go +++ b/server/client/tx_store.go @@ -3,7 +3,7 @@ package client import ( "container/list" - "github.com/go-stomp/stomp/frame" + "github.com/go-stomp/stomp/v3/frame" ) type txStore struct { diff --git a/server/client/tx_store_test.go b/server/client/tx_store_test.go index 11d3d77..eca2774 100644 --- a/server/client/tx_store_test.go +++ b/server/client/tx_store_test.go @@ -1,7 +1,7 @@ package client import ( - "github.com/go-stomp/stomp/frame" + "github.com/go-stomp/stomp/v3/frame" . "gopkg.in/check.v1" ) diff --git a/server/processor.go b/server/processor.go index cf72cbd..0360d9c 100644 --- a/server/processor.go +++ b/server/processor.go @@ -6,10 +6,10 @@ import ( "strings" "time" - "github.com/go-stomp/stomp/frame" - "github.com/go-stomp/stomp/server/client" - "github.com/go-stomp/stomp/server/queue" - "github.com/go-stomp/stomp/server/topic" + "github.com/go-stomp/stomp/v3/frame" + "github.com/go-stomp/stomp/v3/server/client" + "github.com/go-stomp/stomp/v3/server/queue" + "github.com/go-stomp/stomp/v3/server/topic" ) type requestProcessor struct { diff --git a/server/queue/memory_queue.go b/server/queue/memory_queue.go index 7e6afdc..ebd204e 100644 --- a/server/queue/memory_queue.go +++ b/server/queue/memory_queue.go @@ -3,7 +3,7 @@ package queue import ( "container/list" - "github.com/go-stomp/stomp/frame" + "github.com/go-stomp/stomp/v3/frame" ) // In-memory implementation of the QueueStorage interface. diff --git a/server/queue/memory_queue_test.go b/server/queue/memory_queue_test.go index aa2ecbc..7037291 100644 --- a/server/queue/memory_queue_test.go +++ b/server/queue/memory_queue_test.go @@ -1,7 +1,7 @@ package queue import ( - "github.com/go-stomp/stomp/frame" + "github.com/go-stomp/stomp/v3/frame" . "gopkg.in/check.v1" ) diff --git a/server/queue/queue.go b/server/queue/queue.go index 0971a12..6b7beab 100644 --- a/server/queue/queue.go +++ b/server/queue/queue.go @@ -4,8 +4,8 @@ Package queue provides implementations of server-side queues. package queue import ( - "github.com/go-stomp/stomp/frame" - "github.com/go-stomp/stomp/server/client" + "github.com/go-stomp/stomp/v3/frame" + "github.com/go-stomp/stomp/v3/server/client" ) // Queue for storing message frames. diff --git a/server/queue/storage.go b/server/queue/storage.go index 5700a6f..9d6eead 100644 --- a/server/queue/storage.go +++ b/server/queue/storage.go @@ -1,7 +1,7 @@ package queue import ( - "github.com/go-stomp/stomp/frame" + "github.com/go-stomp/stomp/v3/frame" ) // Interface for queue storage. The intent is that diff --git a/server/queue_storage.go b/server/queue_storage.go index 17ce86f..d922597 100644 --- a/server/queue_storage.go +++ b/server/queue_storage.go @@ -1,7 +1,7 @@ package server import ( - "github.com/go-stomp/stomp/frame" + "github.com/go-stomp/stomp/v3/frame" ) // QueueStorage is an interface that abstracts the queue storage mechanism. diff --git a/server/server_test.go b/server/server_test.go index 010a809..f5776c0 100644 --- a/server/server_test.go +++ b/server/server_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/go-stomp/stomp" + "github.com/go-stomp/stomp/v3" . "gopkg.in/check.v1" ) diff --git a/server/topic/subscription.go b/server/topic/subscription.go index cb38d37..956c347 100644 --- a/server/topic/subscription.go +++ b/server/topic/subscription.go @@ -1,7 +1,7 @@ package topic import ( - "github.com/go-stomp/stomp/frame" + "github.com/go-stomp/stomp/v3/frame" ) // Subscription is the interface that wraps a subscriber to a topic. diff --git a/server/topic/topic.go b/server/topic/topic.go index d7eae31..afe4c85 100644 --- a/server/topic/topic.go +++ b/server/topic/topic.go @@ -6,7 +6,7 @@ package topic import ( "container/list" - "github.com/go-stomp/stomp/frame" + "github.com/go-stomp/stomp/v3/frame" ) // A Topic is used for broadcasting to subscribed clients. diff --git a/server/topic/topic_test.go b/server/topic/topic_test.go index fa09830..863c0d1 100644 --- a/server/topic/topic_test.go +++ b/server/topic/topic_test.go @@ -1,7 +1,7 @@ package topic import ( - "github.com/go-stomp/stomp/frame" + "github.com/go-stomp/stomp/v3/frame" . "gopkg.in/check.v1" ) diff --git a/stompd/main.go b/stompd/main.go index c94d1c5..8be250f 100644 --- a/stompd/main.go +++ b/stompd/main.go @@ -18,7 +18,7 @@ import ( "net" "os" - "github.com/go-stomp/stomp/server" + "github.com/go-stomp/stomp/v3/server" ) // TODO: experimenting with ways to gracefully shutdown the server, diff --git a/subscribe_options.go b/subscribe_options.go index 096390c..e5a5b18 100644 --- a/subscribe_options.go +++ b/subscribe_options.go @@ -1,7 +1,7 @@ package stomp import ( - "github.com/go-stomp/stomp/frame" + "github.com/go-stomp/stomp/v3/frame" ) // SubscribeOpt contains options for for the Conn.Subscribe function. diff --git a/subscription.go b/subscription.go index 18d192b..97d8862 100644 --- a/subscription.go +++ b/subscription.go @@ -6,7 +6,7 @@ import ( "sync" "sync/atomic" - "github.com/go-stomp/stomp/frame" + "github.com/go-stomp/stomp/v3/frame" ) const ( diff --git a/transaction.go b/transaction.go index 904c5a4..0a8398f 100644 --- a/transaction.go +++ b/transaction.go @@ -1,7 +1,7 @@ package stomp import ( - "github.com/go-stomp/stomp/frame" + "github.com/go-stomp/stomp/v3/frame" ) // A Transaction applies to the sending of messages to the STOMP server, diff --git a/validator.go b/validator.go index 73e3439..8e64a2c 100644 --- a/validator.go +++ b/validator.go @@ -1,7 +1,7 @@ package stomp import ( - "github.com/go-stomp/stomp/frame" + "github.com/go-stomp/stomp/v3/frame" ) // Validator is an interface for validating STOMP frames. diff --git a/version_test.go b/version_test.go index 9175326..c9de88f 100644 --- a/version_test.go +++ b/version_test.go @@ -3,7 +3,7 @@ package stomp_test import ( "testing" - "github.com/go-stomp/stomp" + "github.com/go-stomp/stomp/v3" ) func TestSupportsNack(t *testing.T) {