@@ -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
3863func (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/
4691func (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/
54120func (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/
62144func (client * GlideClient ) Select (index int64 ) (string , error ) {
63145 result , err := client .executeCommand (C .Select , []string {utils .IntToString (index )})
64146 if err != nil {
0 commit comments