reportrender

package
v0.10.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 29, 2026 License: MIT Imports: 6 Imported by: 0

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 CLIReport

func CLIReport(report *ci.Report) (string, error)

CLIReport renders a report for terminal output.

func CLISection

func CLISection(section ci.ReportSection) (string, error)

CLISection renders one render-ready section for terminal output.

func MarkdownReport

func MarkdownReport(report *ci.Report) (string, error)

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:
### Warning Policy Check

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL