streamline table api (#101)

This commit is contained in:
T. von Dein
2026-08-09 21:53:47 +02:00
parent 59331fc721
commit 325433ed81
30 changed files with 349 additions and 316 deletions

View File

@@ -100,8 +100,8 @@ func printShards(conf *cfg.Config, shardlist shards.Response) error {
headers = append(headers, "node", "ip")
}
table := printer.NewTable(conf, len(headers), len(shardlist))
table.Addheaders(headers...)
table := printer.NewTable(conf).WithSize(len(headers), len(shardlist)).
WithHeaders(headers...)
for idx, shard := range shardlist {
name := colorzizeShard(conf, *shard.State, *shard.Index)
@@ -163,8 +163,8 @@ func ShardAllocation(conf *cfg.Config, index string) error {
slog.Debug("ES result", "explain", res)
table := printer.NewTable(conf, 2, 10)
table.Addheaders("shard allocation setting", "value")
table := printer.NewTable(conf).WithSize(2, 10).
WithHeaders("shard allocation setting", "value")
table.Entries = [][]any{
{"Index", index},