MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / contractListTableOutput

Function contractListTableOutput

app/cli/cmd/workflow_contract_list.go:49–60  ·  view source on GitHub ↗
(contracts []*action.WorkflowContractItem)

Source from the content-addressed store, hash-verified

47}
48
49func contractListTableOutput(contracts []*action.WorkflowContractItem) error {
50 t := output.NewTableWriter()
51
52 t.AppendHeader(table.Row{"Name", "Latest Revision", "Created At", "Updated At", "# Workflows", "Scope"})
53 for _, p := range contracts {
54 t.AppendRow(table.Row{p.Name, p.LatestRevision, p.CreatedAt.Format(time.RFC822), p.LatestRevisionCreatedAt.Format(time.RFC822), len(p.WorkflowRefs), p.ScopedEntity.String()})
55 }
56
57 t.Render()
58
59 return nil
60}

Callers 1

contractItemTableOutputFunction · 0.85

Calls 3

NewTableWriterFunction · 0.92
RenderMethod · 0.80
StringMethod · 0.65

Tested by

no test coverage detected