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

Function WithFormat

app/controlplane/plugins/sdk/v1/helpers.go:36–57  ·  view source on GitHub ↗
(format string)

Source from the content-addressed store, hash-verified

34type RenderOpt func(r *renderer) error
35
36func WithFormat(format string) RenderOpt {
37 return func(r *renderer) error {
38 switch format {
39 case "text":
40 r.render = func(t table.Writer) string {
41 return t.Render()
42 }
43 case "markdown":
44 r.render = func(t table.Writer) string {
45 return t.RenderMarkdown()
46 }
47 case "html":
48 r.render = func(t table.Writer) string {
49 return t.RenderHTML()
50 }
51 default:
52 return fmt.Errorf("unsupported format %s", format)
53 }
54
55 return nil
56 }
57}
58
59func WithMaxSize(max int) RenderOpt {
60 return func(r *renderer) error {

Callers 1

TestSummaryTableMethod · 0.85

Calls 1

RenderMethod · 0.80

Tested by 1

TestSummaryTableMethod · 0.68