Skip to content

Commit c1cccbb

Browse files
committed
added exposed types for GlideClient
1 parent acff29c commit c1cccbb

File tree

4 files changed

+22
-22
lines changed

4 files changed

+22
-22
lines changed

go/api/base_client.go

Lines changed: 1 addition & 1 deletion
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 [GlideClient] and [GlideClusterClient].
25+
// BaseClient defines an interface for methods common to both [IGlideClient] and [GlideClusterClient].
2626
type BaseClient interface {
2727
StringCommands
2828
HashCommands

go/api/glide_client.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,55 +11,55 @@ import (
1111
)
1212

1313
// GlideClient interface compliance check.
14-
var _ GlideClient = (*glideClient)(nil)
14+
var _ IGlideClient = (*GlideClient)(nil)
1515

16-
// GlideClient is a client used for connection in Standalone mode.
17-
type GlideClient interface {
16+
// IGlideClient is a client used for connection in Standalone mode.
17+
type IGlideClient interface {
1818
BaseClient
1919
GenericCommands
2020
ServerManagementCommands
2121
}
2222

23-
// glideClient implements standalone mode operations by extending baseClient functionality.
24-
type glideClient struct {
23+
// GlideClient implements standalone mode operations by extending baseClient functionality.
24+
type GlideClient struct {
2525
*baseClient
2626
}
2727

28-
// NewGlideClient creates a [GlideClient] in standalone mode using the given [GlideClientConfiguration].
29-
func NewGlideClient(config *GlideClientConfiguration) (GlideClient, error) {
28+
// NewGlideClient creates a [IGlideClient] in standalone mode using the given [GlideClientConfiguration].
29+
func NewGlideClient(config *GlideClientConfiguration) (IGlideClient, error) {
3030
client, err := createClient(config)
3131
if err != nil {
3232
return nil, err
3333
}
3434

35-
return &glideClient{client}, nil
35+
return &GlideClient{client}, nil
3636
}
3737

38-
func (client *glideClient) CustomCommand(args []string) (interface{}, error) {
38+
func (client *GlideClient) CustomCommand(args []string) (interface{}, error) {
3939
res, err := client.executeCommand(C.CustomCommand, args)
4040
if err != nil {
4141
return nil, err
4242
}
4343
return handleInterfaceResponse(res)
4444
}
4545

46-
func (client *glideClient) ConfigSet(parameters map[string]string) (string, error) {
46+
func (client *GlideClient) ConfigSet(parameters map[string]string) (string, error) {
4747
result, err := client.executeCommand(C.ConfigSet, utils.MapToString(parameters))
4848
if err != nil {
4949
return "", err
5050
}
5151
return handleStringResponse(result)
5252
}
5353

54-
func (client *glideClient) ConfigGet(args []string) (map[string]string, error) {
54+
func (client *GlideClient) ConfigGet(args []string) (map[string]string, error) {
5555
res, err := client.executeCommand(C.ConfigGet, args)
5656
if err != nil {
5757
return nil, err
5858
}
5959
return handleStringToStringMapResponse(res)
6060
}
6161

62-
func (client *glideClient) Select(index int64) (string, error) {
62+
func (client *GlideClient) Select(index int64) (string, error) {
6363
result, err := client.executeCommand(C.Select, []string{utils.IntToString(index)})
6464
if err != nil {
6565
return "", err

go/integTest/glide_test_suite_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ type GlideTestSuite struct {
2424
clusterHosts []api.NodeAddress
2525
tls bool
2626
serverVersion string
27-
clients []api.GlideClient
27+
clients []api.IGlideClient
2828
clusterClients []api.GlideClusterClient
2929
}
3030

@@ -227,15 +227,15 @@ func (suite *GlideTestSuite) getDefaultClients() []api.BaseClient {
227227
return []api.BaseClient{suite.defaultClient(), suite.defaultClusterClient()}
228228
}
229229

230-
func (suite *GlideTestSuite) defaultClient() api.GlideClient {
230+
func (suite *GlideTestSuite) defaultClient() api.IGlideClient {
231231
config := api.NewGlideClientConfiguration().
232232
WithAddress(&suite.standaloneHosts[0]).
233233
WithUseTLS(suite.tls).
234234
WithRequestTimeout(5000)
235235
return suite.client(config)
236236
}
237237

238-
func (suite *GlideTestSuite) client(config *api.GlideClientConfiguration) api.GlideClient {
238+
func (suite *GlideTestSuite) client(config *api.GlideClientConfiguration) api.IGlideClient {
239239
client, err := api.NewGlideClient(config)
240240

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

go/integTest/shared_commands_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4098,7 +4098,7 @@ func sendWithCustomCommand(suite *GlideTestSuite, client api.BaseClient, args []
40984098
var res any
40994099
var err error
41004100
switch c := client.(type) {
4101-
case api.GlideClient:
4101+
case api.IGlideClient:
41024102
res, err = c.CustomCommand(args)
41034103
case api.GlideClusterClient:
41044104
res, err = c.CustomCommand(args)
@@ -4396,7 +4396,7 @@ func (suite *GlideTestSuite) TestXRead() {
43964396

43974397
// ensure that commands doesn't time out even if timeout > request timeout
43984398
var testClient api.BaseClient
4399-
if _, ok := client.(api.GlideClient); ok {
4399+
if _, ok := client.(api.IGlideClient); ok {
44004400
testClient = suite.client(api.NewGlideClientConfiguration().
44014401
WithAddress(&suite.standaloneHosts[0]).
44024402
WithUseTLS(suite.tls))
@@ -5412,7 +5412,7 @@ func (suite *GlideTestSuite) TestXPending() {
54125412
// each use of CustomCommand would make the tests difficult to read and maintain. These tests can be
54135413
// collapsed once the native commands are added in a subsequent release.
54145414

5415-
execStandalone := func(client api.GlideClient) {
5415+
execStandalone := func(client api.IGlideClient) {
54165416
// 1. Arrange the data
54175417
key := uuid.New().String()
54185418
groupName := "group" + uuid.New().String()
@@ -5568,7 +5568,7 @@ func (suite *GlideTestSuite) TestXPending() {
55685568
// this is only needed in order to be able to use custom commands.
55695569
// Once the native commands are added, this logic will be refactored.
55705570
switch c := client.(type) {
5571-
case api.GlideClient:
5571+
case api.IGlideClient:
55725572
execStandalone(c)
55735573
case api.GlideClusterClient:
55745574
execCluster(c)
@@ -5586,7 +5586,7 @@ func (suite *GlideTestSuite) TestXPendingFailures() {
55865586
// each use of CustomCommand would make the tests difficult to read and maintain. These tests can be
55875587
// collapsed once the native commands are added in a subsequent release.
55885588

5589-
execStandalone := func(client api.GlideClient) {
5589+
execStandalone := func(client api.IGlideClient) {
55905590
// 1. Arrange the data
55915591
key := uuid.New().String()
55925592
missingKey := uuid.New().String()
@@ -5892,7 +5892,7 @@ func (suite *GlideTestSuite) TestXPendingFailures() {
58925892
// this is only needed in order to be able to use custom commands.
58935893
// Once the native commands are added, this logic will be refactored.
58945894
switch c := client.(type) {
5895-
case api.GlideClient:
5895+
case api.IGlideClient:
58965896
execStandalone(c)
58975897
case api.GlideClusterClient:
58985898
execCluster(c)

0 commit comments

Comments
 (0)