diff options
| author | Jeff Carr <[email protected]> | 2025-10-09 06:23:27 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-09 06:44:13 -0500 |
| commit | ba18b532de1b19d634b7a275f14c9d846bcc0121 (patch) | |
| tree | 9991ca26e67e92601973aabc781b07a80fe0c788 /tablePackages.go | |
| parent | 4b2374728c07acc3eb809a8ed3cc03150f6b8027 (diff) | |
cleanup the .proto
Diffstat (limited to 'tablePackages.go')
| -rw-r--r-- | tablePackages.go | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/tablePackages.go b/tablePackages.go new file mode 100644 index 0000000..0a95ef6 --- /dev/null +++ b/tablePackages.go @@ -0,0 +1,48 @@ +// Copyright 2025 WIT.COM Inc Licensed GPL 3.0 + +package zoopb + +import ( + "go.wit.com/log" +) + +// this is the default table layout for repos in forge + +func (pb *Packages) PrintTable() string { + tablePB := pb.MakeDefaultTable() + tablePB.PrintTable() + return log.Sprintf("pb.DefaultTable: %d packages", pb.Len()) +} + +func (pb *Packages) MakeDefaultTable() *PackagesTable { + t := pb.NewTable("apt packages") + t.NewUuid() + + var col *PackageFunc + + col = t.AddStringFunc(" I", func(p *Package) string { + if p.Installed { + return " X" + } + return "" + }) + col.Width = 3 + + col = t.AddMD5SUM() + col.Width = 6 + + col = t.AddSHA256() + col.Width = 6 + + col = t.AddPackage() + col.Width = 30 + + col = t.AddVersion() + col.Width = 20 + + col = t.AddFilename() + col.Width = -1 + col.Header.Name = "apt package path" + + return t +} |
