-
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.
Go: Implement Echo Connection Management Cluster (#2993)
* Implement Echo Connection Management Cluster Signed-off-by: EdricCua <[email protected]>
- Loading branch information
Showing
4 changed files
with
115 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
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,27 @@ | ||
// Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0 | ||
|
||
package options | ||
|
||
// Optional arguments for `Echo` for standalone client | ||
type EchoOptions struct { | ||
Message string | ||
} | ||
|
||
// Optional arguments for `Echo` for cluster client | ||
type ClusterEchoOptions struct { | ||
*EchoOptions | ||
// Specifies the routing configuration for the command. | ||
// The client will route the command to the nodes defined by *Route*. | ||
*RouteOption | ||
} | ||
|
||
func (opts *EchoOptions) ToArgs() []string { | ||
if opts == nil { | ||
return []string{} | ||
} | ||
args := []string{} | ||
if opts.Message != "" { | ||
args = append(args, opts.Message) | ||
} | ||
return args | ||
} |
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