Skip to content

Commit 78715d6

Browse files
committed
Merge remote-tracking branch 'upstream/main' into go/pkgsite-fix
Signed-off-by: Edward Liang <edward.liang@improving.com>
2 parents a5eda6f + 502a8d7 commit 78715d6

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

go/api/base_client.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"google.golang.org/protobuf/proto"
2323
)
2424

25-
// BaseClient defines an interface for methods common to both [IGlideClient] and [GlideClusterClient].
25+
// BaseClient defines an interface for methods common to both [IGlideClient] and [IGlideClusterClient].
2626
type BaseClient interface {
2727
StringCommands
2828
HashCommands
@@ -1275,8 +1275,8 @@ func (client *baseClient) HScan(key string, cursor string) (string, []string, er
12751275
// // Assume key contains a hash {{"a": "1"}, {"b", "2"}}
12761276
// opts := options.NewHashScanOptionsBuilder().SetMatch("a")
12771277
// resCursor, resCollection, err = client.HScan(key, initialCursor, opts)
1278-
// // resCursor = {0 false}
1279-
// // resCollection = [{a false} {1 false}]
1278+
// // resCursor = 0
1279+
// // resCollection = [a 1]
12801280
// // The resCollection only contains the hash map entry that matches with the match option provided with the command
12811281
// // input.
12821282
//

go/api/glide_cluster_client.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,27 @@ package api
77
import "C"
88

99
// GlideClusterClient interface compliance check.
10-
var _ GlideClusterClient = (*glideClusterClient)(nil)
10+
var _ IGlideClusterClient = (*GlideClusterClient)(nil)
1111

12-
// GlideClusterClient is a client used for connection in cluster mode.
13-
type GlideClusterClient interface {
12+
// IGlideClusterClient is a client used for connection in cluster mode.
13+
type IGlideClusterClient interface {
1414
BaseClient
1515
GenericClusterCommands
1616
}
1717

18-
// glideClusterClient implements cluster mode operations by extending baseClient functionality.
19-
type glideClusterClient struct {
18+
// GlideClusterClient implements cluster mode operations by extending baseClient functionality.
19+
type GlideClusterClient struct {
2020
*baseClient
2121
}
2222

23-
// NewGlideClusterClient creates a [GlideClusterClient] in cluster mode using the given [GlideClusterClientConfiguration].
24-
func NewGlideClusterClient(config *GlideClusterClientConfiguration) (GlideClusterClient, error) {
23+
// NewGlideClusterClient creates a [IGlideClusterClient] in cluster mode using the given [GlideClusterClientConfiguration].
24+
func NewGlideClusterClient(config *GlideClusterClientConfiguration) (IGlideClusterClient, error) {
2525
client, err := createClient(config)
2626
if err != nil {
2727
return nil, err
2828
}
2929

30-
return &glideClusterClient{client}, nil
30+
return &GlideClusterClient{client}, nil
3131
}
3232

3333
// CustomCommand executes a single command, specified by args, without checking inputs. Every part of the command,
@@ -57,7 +57,7 @@ func NewGlideClusterClient(config *GlideClusterClientConfiguration) (GlideCluste
5757
// result.Value().(string): "PONG"
5858
//
5959
// [Valkey GLIDE Wiki]: https://github.com/valkey-io/valkey-glide/wiki/General-Concepts#custom-command
60-
func (client *glideClusterClient) CustomCommand(args []string) (ClusterValue[interface{}], error) {
60+
func (client *GlideClusterClient) CustomCommand(args []string) (ClusterValue[interface{}], error) {
6161
res, err := client.executeCommand(C.CustomCommand, args)
6262
if err != nil {
6363
return CreateEmptyClusterValue(), err

go/integTest/glide_test_suite_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ type GlideTestSuite struct {
2525
tls bool
2626
serverVersion string
2727
clients []api.IGlideClient
28-
clusterClients []api.GlideClusterClient
28+
clusterClients []api.IGlideClusterClient
2929
}
3030

3131
var (
@@ -245,15 +245,15 @@ func (suite *GlideTestSuite) client(config *api.GlideClientConfiguration) api.IG
245245
return client
246246
}
247247

248-
func (suite *GlideTestSuite) defaultClusterClient() api.GlideClusterClient {
248+
func (suite *GlideTestSuite) defaultClusterClient() api.IGlideClusterClient {
249249
config := api.NewGlideClusterClientConfiguration().
250250
WithAddress(&suite.clusterHosts[0]).
251251
WithUseTLS(suite.tls).
252252
WithRequestTimeout(5000)
253253
return suite.clusterClient(config)
254254
}
255255

256-
func (suite *GlideTestSuite) clusterClient(config *api.GlideClusterClientConfiguration) api.GlideClusterClient {
256+
func (suite *GlideTestSuite) clusterClient(config *api.GlideClusterClientConfiguration) api.IGlideClusterClient {
257257
client, err := api.NewGlideClusterClient(config)
258258

259259
assert.Nil(suite.T(), err)

go/integTest/shared_commands_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4100,7 +4100,7 @@ func sendWithCustomCommand(suite *GlideTestSuite, client api.BaseClient, args []
41004100
switch c := client.(type) {
41014101
case api.IGlideClient:
41024102
res, err = c.CustomCommand(args)
4103-
case api.GlideClusterClient:
4103+
case api.IGlideClusterClient:
41044104
res, err = c.CustomCommand(args)
41054105
default:
41064106
suite.FailNow(errMsg)
@@ -5486,7 +5486,7 @@ func (suite *GlideTestSuite) TestXPending() {
54865486
assert.Equal(suite.T(), streamid_2.Value(), detailResult[1].Id)
54875487
}
54885488

5489-
execCluster := func(client api.GlideClusterClient) {
5489+
execCluster := func(client api.IGlideClusterClient) {
54905490
// 1. Arrange the data
54915491
key := uuid.New().String()
54925492
groupName := "group" + uuid.New().String()
@@ -5570,7 +5570,7 @@ func (suite *GlideTestSuite) TestXPending() {
55705570
switch c := client.(type) {
55715571
case api.IGlideClient:
55725572
execStandalone(c)
5573-
case api.GlideClusterClient:
5573+
case api.IGlideClusterClient:
55745574
execCluster(c)
55755575
}
55765576
})
@@ -5736,7 +5736,7 @@ func (suite *GlideTestSuite) TestXPendingFailures() {
57365736
assert.True(suite.T(), strings.Contains(err.Error(), "WRONGTYPE"))
57375737
}
57385738

5739-
execCluster := func(client api.GlideClusterClient) {
5739+
execCluster := func(client api.IGlideClusterClient) {
57405740
// 1. Arrange the data
57415741
key := uuid.New().String()
57425742
missingKey := uuid.New().String()
@@ -5894,7 +5894,7 @@ func (suite *GlideTestSuite) TestXPendingFailures() {
58945894
switch c := client.(type) {
58955895
case api.IGlideClient:
58965896
execStandalone(c)
5897-
case api.GlideClusterClient:
5897+
case api.IGlideClusterClient:
58985898
execCluster(c)
58995899
}
59005900
})

0 commit comments

Comments
 (0)