diff options
| author | Jeff Carr <[email protected]> | 2025-10-16 06:59:28 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-16 06:59:28 -0500 |
| commit | 180aafc45fb76ba7dd80a52fe7f6f9f1613f7442 (patch) | |
| tree | bedf5aa80efd131f0d917db3c70e336bcc9fd3d7 | |
| parent | 7e506875ef5fb52c54013a68d2f4596935cf7dae (diff) | |
standard table for gowebd
| -rw-r--r-- | tableGowebd.go | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/tableGowebd.go b/tableGowebd.go new file mode 100644 index 0000000..40e56ef --- /dev/null +++ b/tableGowebd.go @@ -0,0 +1,54 @@ +// Copyright 2025 WIT.COM Inc Licensed GPL 3.0 + +package gitpb + +import ( + "go.wit.com/log" +) + +func (pb *Repos) PrintGowebdTable() string { + t := pb.MakeGowebdTable("missing repos table") + + t.PrintTable() + return log.Sprintf("pb.GowebReposTB: total=(%d)", pb.Len()) +} + +func (pb *Repos) MakeGowebdTable(name string) *ReposTable { + t := pb.NewTable(name) + t.NewUuid() + + var col *RepoFunc + // var col int + + col = t.AddNamespace() + col.Width = 30 + + col = t.AddMasterVersion() + // col.SetTitle("mver") + col.Width = 15 + + col = t.AddStringFunc("Tags", func(r *Repo) string { + if r.Tags == nil { + return "nil" + } + // log.Infof("repo: %v\n", r) + return log.Sprintf("len(%d)", r.Tags.Len()) + }) + col.Width = 9 + + col = t.AddStringFunc("cur tag", func(r *Repo) string { + if r.CurrentTag == nil { + return "nil" + } + return "ok" + }) + col.Width = 9 + + col = t.AddDevelVersion() + col.Width = 15 + + col = t.AddFullPath() + col.Width = -1 + + return t +} |
