mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 05:04:18 +02:00
streamline table api (#101)
This commit is contained in:
@@ -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},
|
||||
|
||||
Reference in New Issue
Block a user