Skip to content

Commit

Permalink
Merge pull request #94 from go-stomp/V3
Browse files Browse the repository at this point in the history
BREAKING CHANGE: add module support on new import path
  • Loading branch information
worg authored Mar 25, 2021
2 parents 1509067 + 14f9013 commit a70dd3d
Show file tree
Hide file tree
Showing 36 changed files with 77 additions and 57 deletions.
16 changes: 3 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion ack.go
Original file line number Diff line number Diff line change
@@ -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
Expand Down
24 changes: 21 additions & 3 deletions breaking_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion conn_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions conn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion errors.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package stomp

import (
"github.com/go-stomp/stomp/frame"
"github.com/go-stomp/stomp/v3/frame"
)

// Error values
Expand Down
4 changes: 2 additions & 2 deletions example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion examples/client_test/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"os"

"github.com/go-stomp/stomp"
"github.com/go-stomp/stomp/v3"
)

const defaultPort = ":61613"
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/go-stomp/stomp/v3

go 1.15

require gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c
7 changes: 7 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -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=
2 changes: 1 addition & 1 deletion message.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion send_options.go
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
4 changes: 2 additions & 2 deletions server/client/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions server/client/frame.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
4 changes: 2 additions & 2 deletions server/client/frame_test.go
Original file line number Diff line number Diff line change
@@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion server/client/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion server/client/subscription.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package client

import (
"github.com/go-stomp/stomp/frame"
"github.com/go-stomp/stomp/v3/frame"
)

type Subscription struct {
Expand Down
2 changes: 1 addition & 1 deletion server/client/tx_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion server/client/tx_store_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package client

import (
"github.com/go-stomp/stomp/frame"
"github.com/go-stomp/stomp/v3/frame"
. "gopkg.in/check.v1"
)

Expand Down
8 changes: 4 additions & 4 deletions server/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion server/queue/memory_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion server/queue/memory_queue_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package queue

import (
"github.com/go-stomp/stomp/frame"
"github.com/go-stomp/stomp/v3/frame"
. "gopkg.in/check.v1"
)

Expand Down
4 changes: 2 additions & 2 deletions server/queue/queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion server/queue/storage.go
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion server/queue_storage.go
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion server/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"testing"
"time"

"github.com/go-stomp/stomp"
"github.com/go-stomp/stomp/v3"
. "gopkg.in/check.v1"
)

Expand Down
2 changes: 1 addition & 1 deletion server/topic/subscription.go
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion server/topic/topic.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion server/topic/topic_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package topic

import (
"github.com/go-stomp/stomp/frame"
"github.com/go-stomp/stomp/v3/frame"
. "gopkg.in/check.v1"
)

Expand Down
2 changes: 1 addition & 1 deletion stompd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion subscribe_options.go
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"sync"
"sync/atomic"

"github.com/go-stomp/stomp/frame"
"github.com/go-stomp/stomp/v3/frame"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion transaction.go
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
2 changes: 1 addition & 1 deletion validator.go
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Loading

0 comments on commit a70dd3d

Please sign in to comment.