exporter

package
v0.1.15 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2020 License: Apache-2.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
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 NewCLIExporter

func NewCLIExporter() *CLIExporter

NewCLIExporter creates a new CLIExporter

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 NewRawExporter

func NewRawExporter() *RawExporter

NewRawExporter creates a new RawExporter

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

Jump to

Keyboard shortcuts

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