Skip to content

Commit 233ec5f

Browse files
committed
api: rename connection_pool to pool
1. Closes #123
1 parent 24e46ea commit 233ec5f

20 files changed

+304
-299
lines changed

Makefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ test:
4444
testdata:
4545
(cd ./testdata; ./generate.sh)
4646

47-
.PHONY: test-connection-pool
48-
test-connection-pool:
49-
@echo "Running tests in connection_pool package"
47+
.PHONY: test-pool
48+
test-pool:
49+
@echo "Running tests in pool package"
5050
go clean -testcache
51-
go test -tags "$(TAGS)" ./connection_pool/ -v -p 1
51+
go test -tags "$(TAGS)" ./pool/ -v -p 1
5252

5353
.PHONY: test-datetime
5454
test-datetime:

README.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ faster than other packages according to public benchmarks.
2828
* [Walking\-through example](#walking-through-example)
2929
* [Migration to v2](#migration-to-v2)
3030
* [multi removed](multi-subpackage)
31+
* [connection_pool renamed to pool](pool-subpackage)
3132
* [msgpack.v5 migration](#msgpackv5-migration)
3233
* [Contributing](#contributing)
3334
* [Alternative connectors](#alternative-connectors)
@@ -161,7 +162,11 @@ The article describes migration from go-tarantool to go-tarantool/v2.
161162

162163
#### multi subpackage
163164

164-
The subpackage has been deleted. You should use connection_pool instead.
165+
The subpackage has been deleted. You should use pool instead.
166+
167+
#### pool subpackage
168+
169+
The connection_pool subpackage has been renamed to pool.
165170

166171
#### msgpack.v5 migration
167172

connection_pool/call_16_test.go renamed to pool/call_16_test.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
//go:build !go_tarantool_call_17
22
// +build !go_tarantool_call_17
33

4-
package connection_pool_test
4+
package pool_test
55

66
import (
77
"testing"
88

99
"github.com/stretchr/testify/require"
10-
"github.com/tarantool/go-tarantool/connection_pool"
10+
"github.com/tarantool/go-tarantool/pool"
1111
"github.com/tarantool/go-tarantool/test_helpers"
1212
)
1313

@@ -17,14 +17,14 @@ func TestCall(t *testing.T) {
1717
err := test_helpers.SetClusterRO(servers, connOpts, roles)
1818
require.Nilf(t, err, "fail to set roles for cluster")
1919

20-
connPool, err := connection_pool.Connect(servers, connOpts)
20+
connPool, err := pool.Connect(servers, connOpts)
2121
require.Nilf(t, err, "failed to connect")
2222
require.NotNilf(t, connPool, "conn is nil after Connect")
2323

2424
defer connPool.Close()
2525

2626
// PreferRO
27-
resp, err := connPool.Call("box.info", []interface{}{}, connection_pool.PreferRO)
27+
resp, err := connPool.Call("box.info", []interface{}{}, pool.PreferRO)
2828
require.Nilf(t, err, "failed to Call")
2929
require.NotNilf(t, resp, "response is nil after Call")
3030
require.GreaterOrEqualf(t, len(resp.Data), 1, "response.Data is empty after Call")
@@ -35,7 +35,7 @@ func TestCall(t *testing.T) {
3535
require.Truef(t, ro, "expected `true` with mode `PreferRO`")
3636

3737
// PreferRW
38-
resp, err = connPool.Call("box.info", []interface{}{}, connection_pool.PreferRW)
38+
resp, err = connPool.Call("box.info", []interface{}{}, pool.PreferRW)
3939
require.Nilf(t, err, "failed to Call")
4040
require.NotNilf(t, resp, "response is nil after Call")
4141
require.GreaterOrEqualf(t, len(resp.Data), 1, "response.Data is empty after Call")
@@ -46,7 +46,7 @@ func TestCall(t *testing.T) {
4646
require.Falsef(t, ro, "expected `false` with mode `PreferRW`")
4747

4848
// RO
49-
resp, err = connPool.Call("box.info", []interface{}{}, connection_pool.RO)
49+
resp, err = connPool.Call("box.info", []interface{}{}, pool.RO)
5050
require.Nilf(t, err, "failed to Call")
5151
require.NotNilf(t, resp, "response is nil after Call")
5252
require.GreaterOrEqualf(t, len(resp.Data), 1, "response.Data is empty after Call")
@@ -57,7 +57,7 @@ func TestCall(t *testing.T) {
5757
require.Truef(t, ro, "expected `true` with mode `RO`")
5858

5959
// RW
60-
resp, err = connPool.Call("box.info", []interface{}{}, connection_pool.RW)
60+
resp, err = connPool.Call("box.info", []interface{}{}, pool.RW)
6161
require.Nilf(t, err, "failed to Call")
6262
require.NotNilf(t, resp, "response is nil after Call")
6363
require.GreaterOrEqualf(t, len(resp.Data), 1, "response.Data is empty after Call")

connection_pool/call_17_test.go renamed to pool/call_17_test.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
//go:build go_tarantool_call_17
22
// +build go_tarantool_call_17
33

4-
package connection_pool_test
4+
package pool_test
55

66
import (
77
"testing"
88

99
"github.com/stretchr/testify/require"
10-
"github.com/tarantool/go-tarantool/connection_pool"
10+
"github.com/tarantool/go-tarantool/pool"
1111
"github.com/tarantool/go-tarantool/test_helpers"
1212
)
1313

@@ -17,14 +17,14 @@ func TestCall(t *testing.T) {
1717
err := test_helpers.SetClusterRO(servers, connOpts, roles)
1818
require.Nilf(t, err, "fail to set roles for cluster")
1919

20-
connPool, err := connection_pool.Connect(servers, connOpts)
20+
connPool, err := pool.Connect(servers, connOpts)
2121
require.Nilf(t, err, "failed to connect")
2222
require.NotNilf(t, connPool, "conn is nil after Connect")
2323

2424
defer connPool.Close()
2525

2626
// PreferRO
27-
resp, err := connPool.Call("box.info", []interface{}{}, connection_pool.PreferRO)
27+
resp, err := connPool.Call("box.info", []interface{}{}, pool.PreferRO)
2828
require.Nilf(t, err, "failed to Call")
2929
require.NotNilf(t, resp, "response is nil after Call")
3030
require.GreaterOrEqualf(t, len(resp.Data), 1, "response.Data is empty after Call")
@@ -35,7 +35,7 @@ func TestCall(t *testing.T) {
3535
require.Truef(t, ro, "expected `true` with mode `PreferRO`")
3636

3737
// PreferRW
38-
resp, err = connPool.Call("box.info", []interface{}{}, connection_pool.PreferRW)
38+
resp, err = connPool.Call("box.info", []interface{}{}, pool.PreferRW)
3939
require.Nilf(t, err, "failed to Call")
4040
require.NotNilf(t, resp, "response is nil after Call")
4141
require.GreaterOrEqualf(t, len(resp.Data), 1, "response.Data is empty after Call")
@@ -46,7 +46,7 @@ func TestCall(t *testing.T) {
4646
require.Falsef(t, ro, "expected `false` with mode `PreferRW`")
4747

4848
// RO
49-
resp, err = connPool.Call("box.info", []interface{}{}, connection_pool.RO)
49+
resp, err = connPool.Call("box.info", []interface{}{}, pool.RO)
5050
require.Nilf(t, err, "failed to Call")
5151
require.NotNilf(t, resp, "response is nil after Call")
5252
require.GreaterOrEqualf(t, len(resp.Data), 1, "response.Data is empty after Call")
@@ -57,7 +57,7 @@ func TestCall(t *testing.T) {
5757
require.Truef(t, ro, "expected `true` with mode `RO`")
5858

5959
// RW
60-
resp, err = connPool.Call("box.info", []interface{}{}, connection_pool.RW)
60+
resp, err = connPool.Call("box.info", []interface{}{}, pool.RW)
6161
require.Nilf(t, err, "failed to Call")
6262
require.NotNilf(t, resp, "response is nil after Call")
6363
require.GreaterOrEqualf(t, len(resp.Data), 1, "response.Data is empty after Call")
File renamed without changes.

connection_pool/connection_pool.go renamed to pool/connection_pool.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// - Automatic master discovery by mode parameter.
99
//
1010
// Since: 1.6.0
11-
package connection_pool
11+
package pool
1212

1313
import (
1414
"errors"

0 commit comments

Comments
 (0)