internal/rework-table (#74)

This commit is contained in:
T. von Dein
2026-07-07 07:29:03 +02:00
parent 92865c0fe2
commit c35ffa5e4b
26 changed files with 300 additions and 362 deletions

View File

@@ -88,7 +88,7 @@ func SnapshotList(conf *cfg.Config) error {
table.Addheaders("name", "index", "start", "orphaned", "status")
for idx, snap := range snapshots {
table.Entries[idx] = []string{
table.Entries[idx] = []any{
snap.Name,
snap.Forindex,
snap.Start,
@@ -122,20 +122,20 @@ func SnapshotShow(conf *cfg.Config, snapshot string) error {
snap := res.Snapshots[0]
table.Entries = [][]string{
table.Entries = [][]any{
{"snapshot", snapshot},
{"uuid", snap.Uuid},
{"repository", *snap.Repository},
{"version_id", fmt.Sprintf("%d", snap.VersionId)},
{"version_id", snap.VersionId},
{"version", *snap.Version},
{"include_global_state", fmt.Sprintf("%t", *snap.IncludeGlobalState)},
{"include_global_state", *snap.IncludeGlobalState},
{"state", *snap.State},
{"start_time", fmt.Sprintf("%s", snap.StartTime)},
{"end_time", fmt.Sprintf("%s", snap.EndTime)},
{"duration_in_millis", fmt.Sprintf("%d", *snap.DurationInMillis)},
{"shards-total", fmt.Sprintf("%d", snap.Shards.Total)},
{"shards-failed", fmt.Sprintf("%d", snap.Shards.Failed)},
{"shards-successful", fmt.Sprintf("%d", snap.Shards.Successful)},
{"start_time", snap.StartTime},
{"end_time", snap.EndTime},
{"duration_in_millis", *snap.DurationInMillis},
{"shards-total", snap.Shards.Total},
{"shards-failed", snap.Shards.Failed},
{"shards-successful", snap.Shards.Successful},
}
if err := table.Print(); err != nil {