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

@@ -104,7 +104,7 @@ func IndexList(conf *cfg.Config) error {
}
}
table := printer.NewTable(conf, 3, size)
table := printer.NewTable(conf).WithSize(3, size)
table.Addheaders("name", "size", "docscount")
for idx, index := range list {
@@ -140,7 +140,7 @@ func IndexShow(conf *cfg.Config, indexpattern string) error {
idx++
}
table := printer.NewTable(conf, 2, 7)
table := printer.NewTable(conf).WithSize(2, 7)
table.Addheaders("index property", "value")
ts, err := strconv.ParseInt(index.Settings.Index.CreationDate.(string), 10, 64)
@@ -263,7 +263,7 @@ func IndexFields(conf *cfg.Config, index string) error {
return fmt.Errorf("failed to retrieve field capabilties: %w", esErrorString(err))
}
table := printer.NewTable(conf, 5, 0)
table := printer.NewTable(conf).WithSize(5, 0)
table.Addheaders("field", "type", "searchable", "aggretable", "metadata")
idx := 0
@@ -336,7 +336,7 @@ func IndexDiskusage(conf *cfg.Config, index string) error {
return errors.New("no disk usage reported for index")
}
table := printer.NewTableEmpty(conf).
table := printer.NewTable(conf).
WithHeaders("field", "bloom filter", "norms", "points", "term vectors", "knn vectors", "total")
for name, field := range diskusage.Fields {