output

package
v0.0.0-...-40d5c52 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package output handles formatting and writing indago scan results. Four formats are supported: stdout (colorized terminal), JSON, Markdown, CSV. All formats are generated from the same ScanResult — the output format is a presentation concern, completely decoupled from scan logic.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteToFile

func WriteToFile(scan dispatcher.ScanResult, format Format, path string) error

WriteToFile writes a scan result to a file at the given path.

Types

type CSVWriter

type CSVWriter struct{}

CSVWriter produces a flat CSV suitable for spreadsheet triage.

func (*CSVWriter) Write

func (cw *CSVWriter) Write(scan dispatcher.ScanResult, w io.Writer) error

type Format

type Format string

Format represents an output format identifier.

const (
	FormatStdout   Format = "stdout"
	FormatJSON     Format = "json"
	FormatMarkdown Format = "markdown"
	FormatCSV      Format = "csv"
)

type JSONWriter

type JSONWriter struct {
	Pretty bool
}

JSONWriter produces structured JSON output, suitable for piping to jq.

func (*JSONWriter) Write

func (jw *JSONWriter) Write(scan dispatcher.ScanResult, w io.Writer) error

type MarkdownWriter

type MarkdownWriter struct{}

MarkdownWriter produces a readable Markdown report.

func (*MarkdownWriter) Write

func (mw *MarkdownWriter) Write(scan dispatcher.ScanResult, w io.Writer) error

type StdoutWriter

type StdoutWriter struct {
	Color bool
}

StdoutWriter produces colorized, human-readable terminal output.

func (*StdoutWriter) Write

func (sw *StdoutWriter) Write(scan dispatcher.ScanResult, w io.Writer) error

type Writer

type Writer interface {
	Write(scan dispatcher.ScanResult, w io.Writer) error
}

Writer writes scan results in a specific format.

func ForFormat

func ForFormat(f Format) (Writer, error)

ForFormat returns a Writer for the given format string.

Jump to

Keyboard shortcuts

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