-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement Echo Connection Management Cluster
Signed-off-by: EdricCua <[email protected]>
- Loading branch information
Showing
5 changed files
with
97 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0 | ||
|
||
package api | ||
|
||
import "github.com/valkey-io/valkey-glide/go/glide/api/options" | ||
|
||
// Supports commands and transactions for the "Connection Management" group of commands for cluster client. | ||
// | ||
// See [valkey.io] for details. | ||
// | ||
// [valkey.io]: https://valkey.io/commands/#connection | ||
type ConnectionManagementClusterCommands interface { | ||
EchoWithOptions(echoOptions *options.EchoOptions) (ClusterValue[interface{}], error) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0 | ||
|
||
package options | ||
|
||
import ( | ||
"github.com/valkey-io/valkey-glide/go/glide/api/config" | ||
) | ||
|
||
type EchoOptions struct { | ||
message string | ||
Route config.Route | ||
} | ||
|
||
func NewEchoOptionsBuilder() *EchoOptions { | ||
return &EchoOptions{} | ||
} | ||
|
||
func (echoOptions *EchoOptions) SetMessage(msg string) *EchoOptions { | ||
echoOptions.message = msg | ||
return echoOptions | ||
} | ||
|
||
func (echoOptions *EchoOptions) SetRoute(route config.Route) *EchoOptions { | ||
echoOptions.Route = route | ||
return echoOptions | ||
} | ||
|
||
func (opts *EchoOptions) ToArgs() ([]string, error) { | ||
args := []string{} | ||
|
||
if opts.message != "" { | ||
args = append(args, opts.message) | ||
} | ||
return args, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters