further table streamlining: work with new table api everywhere

This commit is contained in:
2026-08-09 21:48:03 +02:00
parent b49153bd38
commit 2841a94fe5
27 changed files with 271 additions and 249 deletions

View File

@@ -59,8 +59,8 @@ func IndexTemplateList(conf *cfg.Config, filter string) error {
slog.Debug("res", "index templates", res)
table := printer.NewTable(conf).WithSize(5, 0)
table.Addheaders("name", "description", "index patterns", "priority")
table := printer.NewTable(conf).WithSize(5, 0).
WithHeaders("name", "description", "index patterns", "priority")
tplList := filterIndexTemplates(conf, filter, res.IndexTemplates)
@@ -120,8 +120,8 @@ func IndexTemplateShow(conf *cfg.Config, tplname string) error {
tpl := res.IndexTemplates[0]
table := printer.NewTable(conf).WithSize(2, 6)
table.Addheaders("index template property", "value")
table := printer.NewTable(conf).WithSize(2, 6).
WithHeaders("index template property", "value")
desc, err := json.Marshal(tpl.IndexTemplate.Meta_["description"])
if err != nil {
@@ -148,8 +148,8 @@ func IndexTemplateShow(conf *cfg.Config, tplname string) error {
return err
}
table = printer.NewTable(conf).WithSize(2, 0)
table.Addheaders("index setting property", "value")
table = printer.NewTable(conf).WithSize(2, 0).
WithHeaders("index setting property", "value")
err = getIndexTemplateSettings(conf, tplname, table)
if err != nil {
@@ -162,8 +162,8 @@ func IndexTemplateShow(conf *cfg.Config, tplname string) error {
return err
}
table = printer.NewTable(conf).WithSize(2, 0)
table.Addheaders("index field mapping", "type")
table = printer.NewTable(conf).WithSize(2, 0).
WithHeaders("index field mapping", "type")
if tpl.IndexTemplate.Template.Mappings != nil {
for name, field := range tpl.IndexTemplate.Template.Mappings.Properties {
@@ -441,8 +441,8 @@ func rolloverAliasIndexTemplate(conf *cfg.Config, name string) error {
return nil
}
table := printer.NewTable(conf).WithSize(4, 0)
table.Addheaders("rollover alias", "status", "ack", "new index")
table := printer.NewTable(conf).WithSize(4, 0).
WithHeaders("rollover alias", "status", "ack", "new index")
// apply rollover to all matching aliases, if any
for alias := range aliases {