This commit is contained in:
ted-y 2024-11-22 10:14:21 +09:00 committed by GitHub
commit be62884213
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 0 deletions

View File

@ -3,6 +3,7 @@ package redis
import "context" import "context"
type ClusterCmdable interface { type ClusterCmdable interface {
ClusterMyID(ctx context.Context) *StringCmd
ClusterMyShardID(ctx context.Context) *StringCmd ClusterMyShardID(ctx context.Context) *StringCmd
ClusterSlots(ctx context.Context) *ClusterSlotsCmd ClusterSlots(ctx context.Context) *ClusterSlotsCmd
ClusterShards(ctx context.Context) *ClusterShardsCmd ClusterShards(ctx context.Context) *ClusterShardsCmd
@ -29,6 +30,12 @@ type ClusterCmdable interface {
ReadWrite(ctx context.Context) *StatusCmd ReadWrite(ctx context.Context) *StatusCmd
} }
func (c cmdable) ClusterMyID(ctx context.Context) *StringCmd {
cmd := NewStringCmd(ctx, "cluster", "myid")
_ = c(ctx, cmd)
return cmd
}
func (c cmdable) ClusterMyShardID(ctx context.Context) *StringCmd { func (c cmdable) ClusterMyShardID(ctx context.Context) *StringCmd {
cmd := NewStringCmd(ctx, "cluster", "myshardid") cmd := NewStringCmd(ctx, "cluster", "myshardid")
_ = c(ctx, cmd) _ = c(ctx, cmd)