Documentation
¶
Overview ¶
DOCX report renderer. Consultancies live in Word, so the report ships as a real OOXML.docx – hand-built (no third-party DOCX dependency, matching the "light pure-Go" preference) so we fully control the bytes.
Determinism (reproducible-report / chain-of-custody): the document content is a pure function of ports.ReportDocument, every ZIP entry uses a FIXED modification time, and the parts are written in a FIXED order – so identical engagement data yields byte-identical output and a reproducible SHA-256 seal. All dynamic text is XML-escaped (operator-authored finding text is untrusted).
HTML report renderer. It turns the format-agnostic ports.ReportDocument into a standalone, self-contained HTML document via html/template (auto-escaping closes the injection surface – finding titles/descriptions are untrusted operator text). Output is deterministic: html/template emits identical bytes for identical input, so the SHA-256 seal is reproducible (chain-of-custody).
Package report renders engagement PDF reports with maroto v2. The output is deterministic – the PDF creation-date metadata is pinned to the caller-supplied generatedAt and the content is a pure function of the stored engagement + findings (no LLM in the report path).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DOCXRenderer ¶
type DOCXRenderer struct{}
DOCXRenderer implements ports.DocRenderer for Word (.docx) output.
func NewDOCXRenderer ¶
func NewDOCXRenderer() *DOCXRenderer
NewDOCXRenderer returns a Word report renderer.
func (DOCXRenderer) Render ¶
func (DOCXRenderer) Render(_ context.Context, doc ports.ReportDocument) ([]byte, error)
Render builds a minimal but valid OOXML.docx package for the document, embedding any image exhibits as inline pictures.
type HTMLRenderer ¶
type HTMLRenderer struct {
// contains filtered or unexported fields
}
HTMLRenderer implements ports.DocRenderer for HTML output.
func NewHTMLRenderer ¶
func NewHTMLRenderer() *HTMLRenderer
NewHTMLRenderer compiles the report template once. It panics only on a programmer error (a malformed constant template), never on input.
func (*HTMLRenderer) Render ¶
func (h *HTMLRenderer) Render(_ context.Context, doc ports.ReportDocument) ([]byte, error)
Render writes the document as a self-contained HTML page.
type Renderer ¶
type Renderer struct{}
Renderer implements ports.ReportRenderer using maroto v2.
func (Renderer) Render ¶
func (Renderer) Render(_ context.Context, eng *engagement.Engagement, findings []finding.Finding, insight ports.ReportInsight, generatedAt time.Time, version string) ([]byte, error)
Render builds the engagement report PDF. It never calls an LLM or external service – the document is derived solely from eng + findings.