From 180aafc45fb76ba7dd80a52fe7f6f9f1613f7442 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Thu, 16 Oct 2025 06:59:28 -0500 Subject: standard table for gowebd --- tableGowebd.go | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 tableGowebd.go 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 +} -- cgit v1.2.3