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

@@ -85,7 +85,7 @@ func IlmList(conf *cfg.Config, pattern string) error {
repr.Println(res)
}
table := printer.NewTable(conf, 5, 0)
table := printer.NewTable(conf).WithSize(5, 0)
table.Addheaders("ilm policy", "hot", "warm", "frozen", "delete")
for name, ilm := range res {
@@ -123,7 +123,7 @@ func IlmShow(conf *cfg.Config, policy string) error {
return IlmShowTree(conf, ilm.Policy)
}
table := printer.NewTable(conf, 2, 5)
table := printer.NewTable(conf).WithSize(2, 5)
table.Addheaders("ilm policy setting", "value")
table.Entries = [][]any{
@@ -142,7 +142,7 @@ func IlmShow(conf *cfg.Config, policy string) error {
func IlmShowTree(conf *cfg.Config, ilm types.IlmPolicy) error {
indent := ""
table := printer.NewTable(conf, 4, 0)
table := printer.NewTable(conf).WithSize(4, 0)
table.Addheaders("phase", "min age", "min size", "snapshot repo")
for _, phase := range IlmPhaseOrder {
@@ -280,7 +280,7 @@ func IlmExplain(conf *cfg.Config, index string) error {
ilm := explain.(*types.LifecycleExplainManaged)
table := printer.NewTable(conf, 2, 0)
table := printer.NewTable(conf).WithSize(2, 0)
table.Addheaders("ilm status field", "value")
info := ""