Documentation
¶
Overview ¶
Package reportrender renders producer-agnostic ci.Report payloads for markdown comments and terminal output.
Producers publish render-ready sections through pkg/ci. This package owns presentation only and must not import producer plugin domain models.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CLISection ¶
func CLISection(section ci.ReportSection) (string, error)
CLISection renders one render-ready section for terminal output.
func MarkdownReport ¶
MarkdownReport renders a report using the shared markdown renderer.
Example ¶
package main
import (
"fmt"
"strings"
"github.com/edelwud/terraci/pkg/ci"
"github.com/edelwud/terraci/plugins/internal/reportrender"
)
func main() {
report, err := ci.NewRenderedReport(ci.RenderedReportOptions{
Producer: "policy",
Title: "Policy Check",
Status: ci.ReportStatusWarn,
Summary: "1 warning",
})
if err != nil {
panic(err)
}
rendered, err := reportrender.MarkdownReport(report)
if err != nil {
panic(err)
}
fmt.Println(strings.TrimSpace(rendered))
}
Output: ### warn Policy Check **Status:** warn - 1 warning
func MarkdownSection ¶
func MarkdownSection(section ci.ReportSection) (string, error)
MarkdownSection renders one render-ready section as markdown.
func StatusLabel ¶
func StatusLabel(status ci.ReportStatus) string
StatusLabel returns the stable human-readable status label used by report renderers.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.