Skip to content

Commit

Permalink
refactor: 优化注释
Browse files Browse the repository at this point in the history
  • Loading branch information
huangqing.zhu committed Jul 24, 2024
1 parent b5f311b commit a1559cd
Show file tree
Hide file tree
Showing 6 changed files with 1,333 additions and 95 deletions.
15 changes: 15 additions & 0 deletions cmd_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,14 @@ type ClusterCmdable interface {
// - Bulk string reply: the serialized cluster configuration.
ClusterNodes(ctx context.Context) StringCmd

// ClusterReplicas
// Available since: 5.0.0
// Time complexity: O(N) where N is the number of replicas.
// ACL categories: @admin @slow @dangerous
// RESP2 / RESP3 Reply:
// - Array reply: a list of replica nodes replicating from the specified master node provided in the same format used by CLUSTER NODES.
ClusterReplicas(ctx context.Context, nodeID string) StringSliceCmd

// ClusterReplicate
// Available since: 3.0.0
// Time complexity: O(1)
Expand Down Expand Up @@ -274,6 +282,13 @@ func (c *client) ClusterNodes(ctx context.Context) StringCmd {
return r
}

func (c *client) ClusterReplicas(ctx context.Context, nodeID string) StringSliceCmd {
ctx = c.handler.before(ctx, CommandClusterReplicas)
r := newStringSliceCmd(c.Do(ctx, c.builder.ClusterReplicasCompleted(nodeID)))
c.handler.after(ctx, r.Err())
return r
}

func (c *client) ClusterReplicate(ctx context.Context, nodeID string) StatusCmd {
ctx = c.handler.before(ctx, CommandClusterReplicate)
r := c.adapter.ClusterReplicate(ctx, nodeID)
Expand Down
Loading

0 comments on commit a1559cd

Please sign in to comment.