Skip to content

Commit a5eda6f

Browse files
committed
performed rebase to pass ci
Signed-off-by: Edward Liang <edward.liang@improving.com>
1 parent a537763 commit a5eda6f

10 files changed

+221
-356
lines changed

go/api/base_client.go

Lines changed: 112 additions & 240 deletions
Large diffs are not rendered by default.

go/api/connection_management_commands.go

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,9 @@ package api
88
//
99
// [valkey.io]: https://valkey.io/commands/#connection
1010
type ConnectionManagementCommands interface {
11-
1211
Ping() (string, error)
1312

1413
PingWithMessage(message string) (string, error)
1514

16-
// Echo the provided message back.
17-
// The command will be routed a random node.
18-
//
19-
// Parameters:
20-
// message - The provided message.
21-
//
22-
// Return value:
23-
// The provided message
24-
//
25-
// For example:
26-
// result, err := client.Echo("Hello World")
27-
// if err != nil {
28-
// // handle error
29-
// }
30-
// fmt.Println(result.Value()) // Output: Hello World
31-
//
32-
// [valkey.io]: https://valkey.io/commands/echo/
3315
Echo(message string) (Result[string], error)
3416
}

go/api/generic_cluster_commands.go

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,5 @@ package api
88
//
99
// [valkey.io]: https://valkey.io/commands/#generic
1010
type GenericClusterCommands interface {
11-
// CustomCommand executes a single command, specified by args, without checking inputs. Every part of the command,
12-
// including the command name and subcommands, should be added as a separate value in args. The returning value depends on
13-
// the executed
14-
// command.
15-
//
16-
// The command will be routed automatically based on the passed command's default request policy.
17-
//
18-
// See [Valkey GLIDE Wiki] for details on the restrictions and limitations of the custom command API.
19-
//
20-
// This function should only be used for single-response commands. Commands that don't return complete response and awaits
21-
// (such as SUBSCRIBE), or that return potentially more than a single response (such as XREAD), or that change the client's
22-
// behavior (such as entering pub/sub mode on RESP2 connections) shouldn't be called using this function.
23-
//
24-
// Parameters:
25-
// args - Arguments for the custom command including the command name.
26-
//
27-
// Return value:
28-
// The returned value for the custom command.
29-
//
30-
// For example:
31-
//
32-
// result, err := client.CustomCommand([]string{"ping"})
33-
// result.Value().(string): "PONG"
34-
//
35-
// [Valkey GLIDE Wiki]: https://github.com/valkey-io/valkey-glide/wiki/General-Concepts#custom-command
3611
CustomCommand(args []string) (ClusterValue[interface{}], error)
3712
}

go/api/generic_commands.go

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,5 @@ package api
88
//
99
// [valkey.io]: https://valkey.io/commands/#generic
1010
type GenericCommands interface {
11-
// CustomCommand executes a single command, specified by args, without checking inputs. Every part of the command,
12-
// including the command name and subcommands, should be added as a separate value in args. The returning value depends on
13-
// the executed
14-
// command.
15-
//
16-
// See [Valkey GLIDE Wiki] for details on the restrictions and limitations of the custom command API.
17-
//
18-
// This function should only be used for single-response commands. Commands that don't return complete response and awaits
19-
// (such as SUBSCRIBE), or that return potentially more than a single response (such as XREAD), or that change the client's
20-
// behavior (such as entering pub/sub mode on RESP2 connections) shouldn't be called using this function.
21-
//
22-
// Parameters:
23-
// args - Arguments for the custom command including the command name.
24-
//
25-
// Return value:
26-
// The returned value for the custom command.
27-
//
28-
// For example:
29-
// result, err := client.CustomCommand([]string{"ping"})
30-
// result.(string): "PONG"
31-
//
32-
// [Valkey GLIDE Wiki]: https://github.com/valkey-io/valkey-glide/wiki/General-Concepts#custom-command
3311
CustomCommand(args []string) (interface{}, error)
3412
}

go/api/glide_client.go

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,31 @@ func NewGlideClient(config *GlideClientConfiguration) (IGlideClient, error) {
3535
return &GlideClient{client}, nil
3636
}
3737

38+
// CustomCommand executes a single command, specified by args, without checking inputs. Every part of the command,
39+
// including the command name and subcommands, should be added as a separate value in args. The returning value depends on
40+
// the executed
41+
// command.
42+
//
43+
// See [Valkey GLIDE Wiki] for details on the restrictions and limitations of the custom command API.
44+
//
45+
// This function should only be used for single-response commands. Commands that don't return complete response and awaits
46+
// (such as SUBSCRIBE), or that return potentially more than a single response (such as XREAD), or that change the client's
47+
// behavior (such as entering pub/sub mode on RESP2 connections) shouldn't be called using this function.
48+
//
49+
// Parameters:
50+
//
51+
// args - Arguments for the custom command including the command name.
52+
//
53+
// Return value:
54+
//
55+
// The returned value for the custom command.
56+
//
57+
// For example:
58+
//
59+
// result, err := client.CustomCommand([]string{"ping"})
60+
// result.(string): "PONG"
61+
//
62+
// [Valkey GLIDE Wiki]: https://github.com/valkey-io/valkey-glide/wiki/General-Concepts#custom-command
3863
func (client *GlideClient) CustomCommand(args []string) (interface{}, error) {
3964
res, err := client.executeCommand(C.CustomCommand, args)
4065
if err != nil {
@@ -43,6 +68,26 @@ func (client *GlideClient) CustomCommand(args []string) (interface{}, error) {
4368
return handleInterfaceResponse(res)
4469
}
4570

71+
// Sets configuration parameters to the specified values.
72+
//
73+
// Note: Prior to Version 7.0.0, only one parameter can be send.
74+
//
75+
// See [valkey.io] for details.
76+
//
77+
// Parameters:
78+
//
79+
// parameters - A map consisting of configuration parameters and their respective values to set.
80+
//
81+
// Return value:
82+
//
83+
// `"OK"` if all configurations have been successfully set. Otherwise, raises an error.
84+
//
85+
// For example:
86+
//
87+
// result, err := client.ConfigSet(map[string]string{"timeout": "1000", "maxmemory": "1GB"})
88+
// result: "OK"
89+
//
90+
// [valkey.io]: https://valkey.io/commands/config-set/
4691
func (client *GlideClient) ConfigSet(parameters map[string]string) (string, error) {
4792
result, err := client.executeCommand(C.ConfigSet, utils.MapToString(parameters))
4893
if err != nil {
@@ -51,6 +96,27 @@ func (client *GlideClient) ConfigSet(parameters map[string]string) (string, erro
5196
return handleStringResponse(result)
5297
}
5398

99+
// Gets the values of configuration parameters.
100+
//
101+
// Note: Prior to Version 7.0.0, only one parameter can be send.
102+
//
103+
// See [valkey.io] for details.
104+
//
105+
// Parameters:
106+
//
107+
// args - A slice of configuration parameter names to retrieve values for.
108+
//
109+
// Return value:
110+
//
111+
// A map of api.Result[string] corresponding to the configuration parameters.
112+
//
113+
// For example:
114+
//
115+
// result, err := client.ConfigGet([]string{"timeout" , "maxmemory"})
116+
// // result["timeout"] = "1000"
117+
// // result["maxmemory"] = "1GB"
118+
//
119+
// [valkey.io]: https://valkey.io/commands/config-get/
54120
func (client *GlideClient) ConfigGet(args []string) (map[string]string, error) {
55121
res, err := client.executeCommand(C.ConfigGet, args)
56122
if err != nil {
@@ -59,6 +125,22 @@ func (client *GlideClient) ConfigGet(args []string) (map[string]string, error) {
59125
return handleStringToStringMapResponse(res)
60126
}
61127

128+
// Select changes the currently selected database.
129+
//
130+
// Parameters:
131+
//
132+
// index - The index of the database to select.
133+
//
134+
// Return value:
135+
//
136+
// A simple `"OK"` response.
137+
//
138+
// Example:
139+
//
140+
// result, err := client.Select(2)
141+
// result: "OK"
142+
//
143+
// [valkey.io]: https://valkey.io/commands/select/
62144
func (client *GlideClient) Select(index int64) (string, error) {
63145
result, err := client.executeCommand(C.Select, []string{utils.IntToString(index)})
64146
if err != nil {

go/api/glide_cluster_client.go

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,33 @@ func NewGlideClusterClient(config *GlideClusterClientConfiguration) (GlideCluste
3030
return &glideClusterClient{client}, nil
3131
}
3232

33+
// CustomCommand executes a single command, specified by args, without checking inputs. Every part of the command,
34+
// including the command name and subcommands, should be added as a separate value in args. The returning value depends on
35+
// the executed
36+
// command.
37+
//
38+
// The command will be routed automatically based on the passed command's default request policy.
39+
//
40+
// See [Valkey GLIDE Wiki] for details on the restrictions and limitations of the custom command API.
41+
//
42+
// This function should only be used for single-response commands. Commands that don't return complete response and awaits
43+
// (such as SUBSCRIBE), or that return potentially more than a single response (such as XREAD), or that change the client's
44+
// behavior (such as entering pub/sub mode on RESP2 connections) shouldn't be called using this function.
45+
//
46+
// Parameters:
47+
//
48+
// args - Arguments for the custom command including the command name.
49+
//
50+
// Return value:
51+
//
52+
// The returned value for the custom command.
53+
//
54+
// For example:
55+
//
56+
// result, err := client.CustomCommand([]string{"ping"})
57+
// result.Value().(string): "PONG"
58+
//
59+
// [Valkey GLIDE Wiki]: https://github.com/valkey-io/valkey-glide/wiki/General-Concepts#custom-command
3360
func (client *glideClusterClient) CustomCommand(args []string) (ClusterValue[interface{}], error) {
3461
res, err := client.executeCommand(C.CustomCommand, args)
3562
if err != nil {

go/api/hyperloglog_commands.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ package api
88
//
99
// [valkey.io]: https://valkey.io/commands/#hyperloglog
1010
type HyperLogLogCommands interface {
11-
1211
PfAdd(key string, elements []string) (int64, error)
1312

1413
PfCount(keys []string) (int64, error)

go/api/server_management_commands.go

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -8,57 +8,9 @@ package api
88
//
99
// [valkey.io]: https://valkey.io/commands/#server
1010
type ServerManagementCommands interface {
11-
// Select changes the currently selected database.
12-
//
13-
// Parameters:
14-
// index - The index of the database to select.
15-
//
16-
// Return value:
17-
// A simple `"OK"` response.
18-
//
19-
// Example:
20-
// result, err := client.Select(2)
21-
// result: "OK"
22-
//
23-
// [valkey.io]: https://valkey.io/commands/select/
2411
Select(index int64) (string, error)
2512

26-
// Gets the values of configuration parameters.
27-
//
28-
// Note: Prior to Version 7.0.0, only one parameter can be send.
29-
//
30-
// See [valkey.io] for details.
31-
//
32-
// Parameters:
33-
// args - A slice of configuration parameter names to retrieve values for.
34-
//
35-
// Return value:
36-
// A map of api.Result[string] corresponding to the configuration parameters.
37-
//
38-
// For example:
39-
// result, err := client.ConfigGet([]string{"timeout" , "maxmemory"})
40-
// // result["timeout"] = "1000"
41-
// // result["maxmemory"] = "1GB"
42-
//
43-
// [valkey.io]: https://valkey.io/commands/config-get/
4413
ConfigGet(args []string) (map[string]string, error)
4514

46-
// Sets configuration parameters to the specified values.
47-
//
48-
// Note: Prior to Version 7.0.0, only one parameter can be send.
49-
//
50-
// See [valkey.io] for details.
51-
//
52-
// Parameters:
53-
// parameters - A map consisting of configuration parameters and their respective values to set.
54-
//
55-
// Return value:
56-
// `"OK"` if all configurations have been successfully set. Otherwise, raises an error.
57-
//
58-
// For example:
59-
// result, err := client.ConfigSet(map[string]string{"timeout": "1000", "maxmemory": "1GB"})
60-
// result: "OK"
61-
//
62-
// [valkey.io]: https://valkey.io/commands/config-set/
6315
ConfigSet(parameters map[string]string) (string, error)
6416
}

go/api/stream_commands.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import "github.com/valkey-io/valkey-glide/go/glide/api/options"
1010
//
1111
// [valkey.io]: https://valkey.io/commands/#stream
1212
type StreamCommands interface {
13-
1413
XAdd(key string, values [][]string) (Result[string], error)
1514

1615
XAddWithOptions(key string, values [][]string, options *options.XAddOptions) (Result[string], error)

go/api/string_commands.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ package api
88
//
99
// [valkey.io]: https://valkey.io/commands/#string
1010
type StringCommands interface {
11-
1211
Set(key string, value string) (string, error)
1312

1413
SetWithOptions(key string, value string, options *SetOptions) (Result[string], error)

0 commit comments

Comments
 (0)