streamline table api

This commit is contained in:
2026-08-07 22:59:33 +02:00
parent 59331fc721
commit ce5d7f51c6
25 changed files with 73 additions and 74 deletions

View File

@@ -71,7 +71,7 @@ func checkClusterStatus(conf *cfg.Config, leader, follower string) bool {
status[cluster] = clusterHealth
}
table := printer.NewTable(conf, 3, 6)
table := printer.NewTable(conf).WithSize(3, 6)
table.Addheaders("setting", "leader:"+leader, "follower:"+follower)
@@ -151,7 +151,7 @@ func findIlmErrors(conf *cfg.Config, leader, follower string) bool {
if len(failed[cluster]) > 0 {
idx := 0
table := printer.NewTable(conf, 2, len(failed[cluster]))
table := printer.NewTable(conf).WithSize(2, len(failed[cluster]))
table.Addheaders("ilm errors on "+which, "errors")
for name, count := range failed[cluster] {
@@ -225,7 +225,7 @@ func findIndicesOnlyOnLeader(conf *cfg.Config, indices ClusterIndices, leader, f
}
idx := 0
table := printer.NewTable(conf, 3, len(indexOnlyOnLeader))
table := printer.NewTable(conf).WithSize(3, len(indexOnlyOnLeader))
table.Addheaders("index only on leader", "size", "docscount")
for name, index := range indexOnlyOnLeader {
@@ -275,7 +275,7 @@ func findOrphanedIndices(conf *cfg.Config, indices ClusterIndices, leader, follo
}
idx := 0
table := printer.NewTable(conf, 3, len(orphaned))
table := printer.NewTable(conf).WithSize(3, len(orphaned))
table.Addheaders("orphaned index on follower", "size", "docscount")
for name, index := range orphaned {
@@ -311,7 +311,7 @@ func findFailedFollowerIndices(conf *cfg.Config, indices ClusterIndices, followe
}
idx := 0
table := printer.NewTable(conf, 3, len(red))
table := printer.NewTable(conf).WithSize(3, len(red))
table.Addheaders("red index on follower", "size", "docscount")
for name, index := range red {