Documentation ¶
Index ¶
- Constants
- type CLIExporter
- type Exporter
- type HTMLExporter
- type IntermediateExporter
- func (e *IntermediateExporter) Export(ctx context.Context, policyManifest *packaging.PolicyManifest, ...) (*bytes.Buffer, error)
- func (e *IntermediateExporter) ExportIndex(ctx context.Context, clusterSummary *api.ClusterSummary) (*bytes.Buffer, error)
- func (e *IntermediateExporter) FileExtension() string
- type JSONExporter
- type MarkdownExporter
- type RawExporter
Constants ¶
const ( // FormatCLI is the Comand Line Interface format FormatCLI = "cli" // FormatJSON is a JSON encoded format that contains the results enriched with metadata FormatJSON = "json" // FormatRaw is the raw output out of the evaluation, without metadata, encoded in JSON FormatRaw = "raw" // FormatMD is the markdown report format FormatMD = "markdown" // FormatHTML is the HTML report format FormatHTML = "html" // FormatIntermediate is the intermediate JSON format FormatIntermediate = "intermediate" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CLIExporter ¶
type CLIExporter struct { }
CLIExporter is an Exporter that outputs a report in Command Line Interface format
func (*CLIExporter) Export ¶
func (e *CLIExporter) Export(ctx context.Context, policyManifest *packaging.PolicyManifest, intermediateJSON []byte, results *results.ResultCollection) (*bytes.Buffer, error)
Export writes the CLI report to a buffer
func (*CLIExporter) ExportIndex ¶
func (e *CLIExporter) ExportIndex(ctx context.Context, clusterSummary *api.ClusterSummary) (*bytes.Buffer, error)
ExportIndex formats the supplied cluster summary
func (*CLIExporter) FileExtension ¶
func (e *CLIExporter) FileExtension() string
FileExtension returns the file extension for this exporter's format
type Exporter ¶
type Exporter interface { Export(ctx context.Context, policyManifest *packaging.PolicyManifest, intermediateJSON []byte, results *results.ResultCollection) (*bytes.Buffer, error) ExportIndex(ctx context.Context, clusterIndex *api.ClusterSummary) (*bytes.Buffer, error) FileExtension() string }
Exporter consumes policy manifests, intermediate JSON, and results, and exports them to a buffer in a certain format
type HTMLExporter ¶
type HTMLExporter struct { }
HTMLExporter is an Exporter that outputs a report in HTML format
func NewHTMLExporter ¶
func NewHTMLExporter() *HTMLExporter
NewHTMLExporter creates a new HTMLExporter
func (*HTMLExporter) Export ¶
func (e *HTMLExporter) Export(ctx context.Context, policyManifest *packaging.PolicyManifest, intermediateJSON []byte, results *results.ResultCollection) (*bytes.Buffer, error)
Export writes the HTML report to a buffer
func (*HTMLExporter) ExportIndex ¶
func (e *HTMLExporter) ExportIndex(ctx context.Context, clusterSummary *api.ClusterSummary) (*bytes.Buffer, error)
ExportIndex formats the supplied cluster summary
func (*HTMLExporter) FileExtension ¶
func (e *HTMLExporter) FileExtension() string
FileExtension returns the file extension for this exporter's format
type IntermediateExporter ¶
type IntermediateExporter struct { }
IntermediateExporter is an Exporter that outputs intermediate JSON
func NewIntermediateExporter ¶
func NewIntermediateExporter() *IntermediateExporter
NewIntermediateExporter creates a new IntermediateExporter
func (*IntermediateExporter) Export ¶
func (e *IntermediateExporter) Export(ctx context.Context, policyManifest *packaging.PolicyManifest, intermediateJSON []byte, rc *results.ResultCollection) (*bytes.Buffer, error)
Export writes the intermediate JSON to a buffer
func (*IntermediateExporter) ExportIndex ¶
func (e *IntermediateExporter) ExportIndex(ctx context.Context, clusterSummary *api.ClusterSummary) (*bytes.Buffer, error)
ExportIndex formats the supplied cluster summary
func (*IntermediateExporter) FileExtension ¶
func (e *IntermediateExporter) FileExtension() string
FileExtension returns the file extension for this exporter's format
type JSONExporter ¶
type JSONExporter struct { }
JSONExporter is an Exporter that outputs the results enriched with metadata in a JSON format
func NewJSONExporter ¶
func NewJSONExporter() *JSONExporter
NewJSONExporter creates a new JSONExporter
func (*JSONExporter) Export ¶
func (e *JSONExporter) Export(ctx context.Context, policyManifest *packaging.PolicyManifest, intermediateJSON []byte, rc *results.ResultCollection) (*bytes.Buffer, error)
Export writes a report with the evaluated results enriched with the metadata from the policy manifest in a JSON format.
func (*JSONExporter) ExportIndex ¶
func (e *JSONExporter) ExportIndex(ctx context.Context, clusterSummary *api.ClusterSummary) (*bytes.Buffer, error)
ExportIndex formats the supplied cluster summary
func (*JSONExporter) FileExtension ¶
func (e *JSONExporter) FileExtension() string
FileExtension returns the file extension for this exporter's format
type MarkdownExporter ¶
type MarkdownExporter struct { }
MarkdownExporter is an Exporter that outputs a report in markdown format
func NewMarkdownExporter ¶
func NewMarkdownExporter() *MarkdownExporter
NewMarkdownExporter creates a new MarkdownExporter
func (*MarkdownExporter) Export ¶
func (e *MarkdownExporter) Export(ctx context.Context, policyManifest *packaging.PolicyManifest, intermediateJSON []byte, results *results.ResultCollection) (*bytes.Buffer, error)
Export writes the markdown report to a buffer
func (*MarkdownExporter) ExportIndex ¶
func (e *MarkdownExporter) ExportIndex(ctx context.Context, clusterSummary *api.ClusterSummary) (*bytes.Buffer, error)
ExportIndex formats the supplied cluster summary
func (*MarkdownExporter) FileExtension ¶
func (e *MarkdownExporter) FileExtension() string
FileExtension returns the file extension for this exporter's format
type RawExporter ¶
type RawExporter struct { }
RawExporter is an Exporter that outputs raw JSON results
func (*RawExporter) Export ¶
func (e *RawExporter) Export(ctx context.Context, policyManifest *packaging.PolicyManifest, intermediateJSON []byte, rc *results.ResultCollection) (*bytes.Buffer, error)
Export writes the results to a buffer
func (*RawExporter) ExportIndex ¶
func (e *RawExporter) ExportIndex(ctx context.Context, clusterSummary *api.ClusterSummary) (*bytes.Buffer, error)
ExportIndex formats the supplied cluster summary
func (*RawExporter) FileExtension ¶
func (e *RawExporter) FileExtension() string
FileExtension returns the file extension for this exporter's format