()
| 99 | } |
| 100 | |
| 101 | func (cluster *Cluster) ToSlotString() (string, error) { |
| 102 | var builder strings.Builder |
| 103 | for i, shard := range cluster.Shards { |
| 104 | shardSlotsString, err := shard.ToSlotsString() |
| 105 | if err != nil { |
| 106 | return "", fmt.Errorf("found err at shard[%d]: %w", i, err) |
| 107 | } |
| 108 | builder.WriteString(shardSlotsString) |
| 109 | } |
| 110 | return builder.String(), nil |
| 111 | } |
| 112 | |
| 113 | func (cluster *Cluster) GetShard(shardIndex int) (*Shard, error) { |
| 114 | if shardIndex < 0 || shardIndex >= len(cluster.Shards) { |
no test coverage detected