outputter

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// HOST host key
	HOST = "HOST"
	// USER key
	USER = "USER"
	// PASSWORD key
	PASSWORD = "PASSWORD"
	// SSLMODE key
	SSLMODE = "SSLMODE"
	// DBNAME key
	DBNAME = "DBNAME"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Console
	Format   Format
	Filename string
}

Config configuration for either JSON or Console outputter

type Console

type Console struct {
	NoRemediations    bool
	IncludeTestOutput bool
}

Console outputter functionality for Standard output

func NewConsole

func NewConsole(noRemediations, includeTestOutput bool) *Console

NewConsole creates new Outputter of type Console

func (*Console) Output

func (co *Console) Output(controls *check.Controls, summary check.Summary) error

Output displays Control results to Standard output

type Format

type Format int

Format of the output

const (
	// JSONFormat send json output to console
	JSONFormat Format = iota + 10
	// PgSQLFormat send output to pgsql DB
	PgSQLFormat
	// JUnitFormat send JUnit output to the console
	JUnitFormat
	// ConsoleFormat send output console
	ConsoleFormat
)

type JSON

type JSON struct {
	// contains filtered or unexported fields
}

JSON outputter functionality for JSON payload

func NewJSON

func NewJSON(outputFile string) *JSON

NewJSON creates new Outputter of type JSON

func (*JSON) Output

func (jrp *JSON) Output(controls *check.Controls, summary check.Summary) error

Output displays Control results as JSON payload

type JUnit

type JUnit struct {
	Filename string
	// contains filtered or unexported fields
}

JUnit outputter functionality for JUnit output

func NewJUnit

func NewJUnit(outputFile string) *JUnit

NewJUnit creates new Outputter of type JUnit

func (*JUnit) Output

func (jrp *JUnit) Output(controls *check.Controls, summary check.Summary) error

Output displays Control results as JUnit payload

type Outputter

type Outputter interface {
	Output(controls *check.Controls, summary check.Summary) error
}

Outputter represents the output strategy for Control objects

func BuildOutputter

func BuildOutputter(summary check.Summary, config *Config) Outputter

BuildOutputter builds a new outputter

func BuildOutputterFunc

func BuildOutputterFunc(op func(controls *check.Controls, summary check.Summary) error) (Outputter, error)

BuildOutputterFunc useful extension point to add custom Outputters

type PgSQL

type PgSQL struct {
	// contains filtered or unexported fields
}

PgSQL contains the database connection information

func NewPgSQL

func NewPgSQL(configValues map[string]string) *PgSQL

NewPgSQL constructs a new PgSQL

func (*PgSQL) Output

func (pg *PgSQL) Output(controls *check.Controls, summary check.Summary) error

Output stores JSON payload to the database

Jump to

Keyboard shortcuts

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