()
| 15 | } |
| 16 | |
| 17 | func (c Cluster) BrokerIDs() []int32 { |
| 18 | brokerIDs := make([]int32, 0, len(c.Brokers)) |
| 19 | for id := range c.Brokers { |
| 20 | brokerIDs = append(brokerIDs, id) |
| 21 | } |
| 22 | sort.Slice(brokerIDs, func(i, j int) bool { |
| 23 | return brokerIDs[i] < brokerIDs[j] |
| 24 | }) |
| 25 | return brokerIDs |
| 26 | } |
| 27 | |
| 28 | func (c Cluster) TopicNames() []string { |
| 29 | topicNames := make([]string, 0, len(c.Topics)) |