summaryrefslogtreecommitdiff
path: root/tableStats.go
blob: ba45e31073f3c0411c9cd0ab26cb39841e6096e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright 2025 WIT.COM Inc Licensed GPL 3.0

package gitpb

import (
	"go.wit.com/log"
	"go.wit.com/lib/cobol"
)

func (pb *Stats) PrintTable() string {
	t := pb.MakeTable("missing repos table")

	t.PrintTable()
	return log.Sprintf("pb.StatsTB:  total=(%d)", pb.Len())
}

func (pb *Stats) MakeTable(name string) *StatsTable {
	t := pb.NewTable(name)
	t.NewUuid()

	var col *StatFunc

	col = t.AddPatchId()
	col.Width = 10

	col = t.AddStringFunc("something", func(r *Stat) string {
		return "notsure"
	})
	col.Width = 9

	col = t.AddStringFunc("age", func(r *Stat) string {
		return cobol.Time(r.Ctime)
	})
	col.Width = 28

	col = t.AddSubject()
	col.Width = -1

	return t
}