Skip to content

Commit

Permalink
Release v2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
maksim.konovalov committed Jan 15, 2025
1 parent 0230589 commit 6a04373
Show file tree
Hide file tree
Showing 25 changed files with 56 additions and 42 deletions.
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
## Unreleased
## v2.0.0

We are excited to announce the release of version v2!
This major update was necessary due to the initial design of interfaces that were either incorrect or redundant.
In addition, we have fully adapted to work with Tarantool 3,
eliminating the dependency on UUID-based replica sets and instances.
While you can still use these elements for supplementary information, they are no longer mandatory.
The update also includes changes to several previously public methods,
which were not intended to be exposed in the original vshard implementation.
We would like to express our gratitude to everyone who shared their migration issues with us,
as your feedback was invaluable in shaping the current state of the interfaces.

FEATURES:

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ graph TD
With [Go module](https://github.com/golang/go/wiki/Modules) support, simply add the following import

```
import "github.com/tarantool/go-vshard-router"
import "github.com/tarantool/go-vshard-router/v2"
```
to your code, and then `go [build|run|test]` will automatically fetch the necessary dependencies.

Otherwise, run the following Go command to install the `go-vshard-router` package:

```sh
$ go get -u github.com/tarantool/go-vshard-router
$ go get -u github.com/tarantool/go-vshard-router/v2
```

### Running Go-Vshard-Router
Expand All @@ -95,7 +95,7 @@ import (
"time"

vshardrouter "github.com/tarantool/go-vshard-router"
"github.com/tarantool/go-vshard-router/providers/static"
"github.com/tarantool/go-vshard-router/v2/providers/static"

"github.com/google/uuid"
"github.com/tarantool/go-tarantool/v2"
Expand Down
10 changes: 5 additions & 5 deletions README_ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,14 @@ graph TD
С помощью [Go module](https://github.com/golang/go/wiki/Modules) можно добавить следующий импорт

```
import "github.com/tarantool/go-vshard-router"
import "github.com/tarantool/go-vshard-router/v2"
```
в ваш код, а затем `go [build|run|test]` автоматически получит необходимые зависимости.


В противном случае выполните следующую команду Go, чтобы установить пакет go-vshard-router:
```sh
$ go get -u github.com/tarantool/go-vshard-router
$ go get -u github.com/tarantool/go-vshard-router/v2
```

### Использование Go-Vshard-Router
Expand All @@ -93,8 +93,8 @@ import (
"strconv"
"time"

vshardrouter "github.com/tarantool/go-vshard-router"
"github.com/tarantool/go-vshard-router/providers/static"
vshardrouter "github.com/tarantool/go-vshard-router/v2"
"github.com/tarantool/go-vshard-router/v2/providers/static"

"github.com/google/uuid"
"github.com/tarantool/go-tarantool/v2"
Expand Down Expand Up @@ -215,7 +215,7 @@ func main() {
![Image alt](docs/static/not-direct.png)


[actions-badge]: https://github.com/tarantool/go-vshard-router/actions/workflows/main.yml/badge.svg
[actions-badge]: https://github.com/tarantool/go-vshard-router/v2/actions/workflows/main.yml/badge.svg
[actions-url]: https://github.com/tarantool/go-vshard-router/actions/workflows/main.yml
[coverage-badge]: https://coveralls.io/repos/github/tarantool/go-vshard-router/badge.svg?branch=master
[coverage-url]: https://coveralls.io/github/tarantool/go-vshard-router?branch=master
4 changes: 2 additions & 2 deletions docs/doc_ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ import (

"github.com/google/uuid"
"github.com/tarantool/go-tarantool/v2"
vshardrouter "github.com/tarantool/go-vshard-router"
"github.com/tarantool/go-vshard-router/providers/static"
vshardrouter "github.com/tarantool/go-vshard-router/v2"
"github.com/tarantool/go-vshard-router/v2/providers/static"
)

func main() {
Expand Down
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/tarantool/go-vshard-router
module github.com/tarantool/go-vshard-router/v2

go 1.22

Expand All @@ -8,11 +8,12 @@ require (
github.com/spf13/viper v1.19.0
github.com/stretchr/testify v1.10.0
github.com/tarantool/go-tarantool/v2 v2.2.1
github.com/tarantool/go-vshard-router v1.3.2
github.com/vmihailenco/msgpack/v5 v5.4.1
go.etcd.io/etcd/client/v2 v2.305.17
go.etcd.io/etcd/client/v3 v3.5.17
go.etcd.io/etcd/server/v3 v3.5.17
golang.org/x/sync v0.6.0
golang.org/x/sync v0.10.0
)

require (
Expand Down
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,8 @@ github.com/tarantool/go-iproto v1.1.0 h1:HULVOIHsiehI+FnHfM7wMDntuzUddO09DKqu2Wn
github.com/tarantool/go-iproto v1.1.0/go.mod h1:LNCtdyZxojUed8SbOiYHoc3v9NvaZTB7p96hUySMlIo=
github.com/tarantool/go-tarantool/v2 v2.2.1 h1:ldzMVfkmTuJl4ie3ByMIr+mmPSKDVTcSkN8XlVZEows=
github.com/tarantool/go-tarantool/v2 v2.2.1/go.mod h1:hKKeZeCP8Y8+U6ZFS32ot1jHV/n4WKVP4fjRAvQznMY=
github.com/tarantool/go-vshard-router v1.3.2 h1:30ZQIZGj5U6TaAK8NXgTUYgpns938KDQKApnkcqz2Ps=
github.com/tarantool/go-vshard-router v1.3.2/go.mod h1:+ZRedQeNcP5EUjtQg2BKHS9b40u2A3V+IEo2QqTpKJY=
github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802 h1:uruHq4dN7GR16kFc5fp3d1RIYzJW5onx8Ybykw2YQFA=
github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM=
Expand Down Expand Up @@ -468,8 +470,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ=
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
Expand Down
2 changes: 1 addition & 1 deletion mocks/topology/topology_controller.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion providers/etcd/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"path/filepath"

"github.com/google/uuid"
vshardrouter "github.com/tarantool/go-vshard-router"
vshardrouter "github.com/tarantool/go-vshard-router/v2"
"go.etcd.io/etcd/client/v2"
)

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

import (
"fmt"
mocktopology "github.com/tarantool/go-vshard-router/mocks/topology"
"go.etcd.io/etcd/client/v2"
"testing"
"time"

mocktopology "github.com/tarantool/go-vshard-router/v2/mocks/topology"
"go.etcd.io/etcd/client/v2"
)

func TestNewProvider(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion providers/static/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"fmt"

vshardrouter "github.com/tarantool/go-vshard-router"
vshardrouter "github.com/tarantool/go-vshard-router/v2"
)

// Check that provider implements TopologyProvider interface
Expand Down
2 changes: 1 addition & 1 deletion providers/static/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/google/uuid"
"github.com/stretchr/testify/require"

vshardrouter "github.com/tarantool/go-vshard-router"
vshardrouter "github.com/tarantool/go-vshard-router/v2"
)

func TestNewProvider(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion providers/viper/moonlibs/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"log"

"github.com/google/uuid"
vshardrouter "github.com/tarantool/go-vshard-router"
vshardrouter "github.com/tarantool/go-vshard-router/v2"
)

func (cfg *Config) Convert() map[vshardrouter.ReplicasetInfo][]vshardrouter.InstanceInfo {
Expand Down
6 changes: 3 additions & 3 deletions providers/viper/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (

"github.com/google/uuid"
srcviper "github.com/spf13/viper"
vshardrouter "github.com/tarantool/go-vshard-router"
"github.com/tarantool/go-vshard-router/providers/viper/moonlibs"
"github.com/tarantool/go-vshard-router/providers/viper/tarantool3"
vshardrouter "github.com/tarantool/go-vshard-router/v2"
"github.com/tarantool/go-vshard-router/v2/providers/viper/moonlibs"
"github.com/tarantool/go-vshard-router/v2/providers/viper/tarantool3"
)

// Check that provider implements TopologyProvider interface
Expand Down
2 changes: 1 addition & 1 deletion providers/viper/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/spf13/viper"
_ "github.com/spf13/viper/remote"
"github.com/stretchr/testify/require"
vprovider "github.com/tarantool/go-vshard-router/providers/viper"
vprovider "github.com/tarantool/go-vshard-router/v2/providers/viper"
clientv3 "go.etcd.io/etcd/client/v3"
"go.etcd.io/etcd/server/v3/embed"
)
Expand Down
2 changes: 1 addition & 1 deletion providers/viper/tarantool3/convert.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package tarantool3

import (
vshardrouter "github.com/tarantool/go-vshard-router"
vshardrouter "github.com/tarantool/go-vshard-router/v2"
)

func (cfg *Config) Convert() map[vshardrouter.ReplicasetInfo][]vshardrouter.InstanceInfo {
Expand Down
2 changes: 1 addition & 1 deletion providers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/stretchr/testify/require"

vshardrouter "github.com/tarantool/go-vshard-router"
vshardrouter "github.com/tarantool/go-vshard-router/v2"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion replicaset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/tarantool/go-tarantool/v2"
"github.com/vmihailenco/msgpack/v5"

mockpool "github.com/tarantool/go-vshard-router/mocks/pool"
mockpool "github.com/tarantool/go-vshard-router/v2/mocks/pool"
)

func TestReplicasetInfo_String(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions tarantool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import (
"github.com/tarantool/go-tarantool/v2/box"
"github.com/tarantool/go-tarantool/v2/pool"
"github.com/tarantool/go-tarantool/v2/test_helpers"
vshardrouter "github.com/tarantool/go-vshard-router"
"github.com/tarantool/go-vshard-router/providers/static"
chelper "github.com/tarantool/go-vshard-router/test_helper"
vshardrouter "github.com/tarantool/go-vshard-router/v2"
"github.com/tarantool/go-vshard-router/v2/providers/static"
chelper "github.com/tarantool/go-vshard-router/v2/test_helper"
"github.com/vmihailenco/msgpack/v5"
)

Expand Down
4 changes: 2 additions & 2 deletions tests/tnt/call_bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"github.com/stretchr/testify/require"
"github.com/tarantool/go-tarantool/v2"
"github.com/tarantool/go-tarantool/v2/pool"
vshardrouter "github.com/tarantool/go-vshard-router"
"github.com/tarantool/go-vshard-router/providers/static"
vshardrouter "github.com/tarantool/go-vshard-router/v2"
"github.com/tarantool/go-vshard-router/v2/providers/static"
)

type Product struct {
Expand Down
2 changes: 1 addition & 1 deletion tests/tnt/cfgmaker.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"

"github.com/google/uuid"
vshardrouter "github.com/tarantool/go-vshard-router"
vshardrouter "github.com/tarantool/go-vshard-router/v2"
)

type cfgmaker struct {
Expand Down
2 changes: 1 addition & 1 deletion tests/tnt/concurrent_topology_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"time"

"github.com/stretchr/testify/require"
vshardrouter "github.com/tarantool/go-vshard-router"
vshardrouter "github.com/tarantool/go-vshard-router/v2"
)

type concurrentTopologyProvider struct {
Expand Down
4 changes: 2 additions & 2 deletions tests/tnt/replicaset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"github.com/stretchr/testify/require"
"github.com/tarantool/go-tarantool/v2"
"github.com/tarantool/go-tarantool/v2/pool"
vshardrouter "github.com/tarantool/go-vshard-router"
"github.com/tarantool/go-vshard-router/providers/static"
vshardrouter "github.com/tarantool/go-vshard-router/v2"
"github.com/tarantool/go-vshard-router/v2/providers/static"
)

func TestReplicsetCallAsync(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion tests/tnt/tnt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"strconv"
"testing"

vshardrouter "github.com/tarantool/go-vshard-router"
vshardrouter "github.com/tarantool/go-vshard-router/v2"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion topology_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/google/uuid"
"github.com/stretchr/testify/require"
mockpool "github.com/tarantool/go-vshard-router/mocks/pool"
mockpool "github.com/tarantool/go-vshard-router/v2/mocks/pool"
)

func TestRouter_Topology(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions vshard_shadow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"github.com/google/uuid"
"github.com/stretchr/testify/require"

vshardrouter "github.com/tarantool/go-vshard-router"
"github.com/tarantool/go-vshard-router/providers/static"
vshardrouter "github.com/tarantool/go-vshard-router/v2"
"github.com/tarantool/go-vshard-router/v2/providers/static"
)

type errorTopologyProvider struct{}
Expand Down

0 comments on commit 6a04373

Please sign in to comment.