exporter

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

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) 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)
	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) 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) 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) 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) 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) 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