add support for multiple keyring

This commit is contained in:
Maidul Islam
2022-12-24 19:11:23 -05:00
parent 79333657ed
commit f22d4277dc
9 changed files with 372 additions and 43 deletions

View File

@@ -0,0 +1,35 @@
package visualize
import (
"os"
"github.com/jedib0t/go-pretty/table"
)
// Given headers and rows, this function will print out a table
func Table(headers []string, rows [][]string) {
t := table.NewWriter()
t.SetOutputMirror(os.Stdout)
t.SetStyle(table.StyleLight)
// t.SetTitle("Title")
t.Style().Options.DrawBorder = true
t.Style().Options.SeparateHeader = true
t.Style().Options.SeparateColumns = true
tableHeaders := table.Row{}
for _, header := range headers {
tableHeaders = append(tableHeaders, header)
}
t.AppendHeader(tableHeaders)
for _, row := range rows {
tableRow := table.Row{}
for _, val := range row {
tableRow = append(tableRow, val)
}
t.AppendRow(tableRow)
}
t.Render()
}