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

@@ -47,7 +47,7 @@ func RoleList(conf *cfg.Config) error {
slog.Debug("ES result", "roles", res)
table := printer.NewTable(conf, 3, len(res))
table := printer.NewTable(conf).WithSize(3, len(res))
table.Addheaders("role", "index roles", "cluster roles")
idx := 0
@@ -126,7 +126,7 @@ func roleRemoteClusters(conf *cfg.Config, role types.Role) error {
return nil
}
table := printer.NewTable(conf, 2, len(role.RemoteCluster))
table := printer.NewTable(conf).WithSize(2, len(role.RemoteCluster))
table.Addheaders("remote cluster", "privilege")
idx := 0
@@ -152,7 +152,7 @@ func roleClusters(conf *cfg.Config, role types.Role) error {
return nil
}
table := printer.NewTable(conf, 1, len(role.Cluster))
table := printer.NewTable(conf).WithSize(1, len(role.Cluster))
table.Addheaders("cluster rights")
idx := 0
@@ -171,7 +171,7 @@ func roleRemoteIndices(conf *cfg.Config, role types.Role) error {
return nil
}
table := printer.NewTable(conf, 3, len(role.RemoteIndices))
table := printer.NewTable(conf).WithSize(3, len(role.RemoteIndices))
table.Addheaders("remote index names", "index permissions", "allow restricted")
idx := 0
@@ -197,7 +197,7 @@ func roleIndices(conf *cfg.Config, role types.Role) error {
return nil
}
table := printer.NewTable(conf, 3, len(role.Indices))
table := printer.NewTable(conf).WithSize(3, len(role.Indices))
table.Addheaders("index names", "index permissions", "allow restricted")
idx := 0
@@ -223,7 +223,7 @@ func roleApplications(conf *cfg.Config, role types.Role) error {
return nil
}
table := printer.NewTable(conf, 3, len(role.Applications))
table := printer.NewTable(conf).WithSize(3, len(role.Applications))
table.Addheaders("application", "privileges", "resources")
idx := 0