Documentation ¶
Overview ¶
Package outputs implements data output produced by the application
Index ¶
- Constants
- type ClusterDumpCollector
- type DocumentationBuilder
- type FileWriter
- type JSONResultCollector
- type MarkdownPolicyDocumentation
- type OSFileWriter
- type Output
- func (o *Output) ErrorPrint(message string, cause error) (n int, err error)
- func (o *Output) InitTabs(minColWidth int, tabPadding int)
- func (o *Output) Printf(format string, a ...interface{}) (n int, err error)
- func (o *Output) TabFlush() (err error)
- func (o *Output) TabPrintf(format string, a ...interface{}) (n int, err error)
- type PolicyDocumentation
- type PubSubClient
- type StorageClient
- type ValidationReport
- type ValidationReportClusterEvaluation
- type ValidationReportClusterStats
- type ValidationReportMapper
- type ValidationReportPolicy
- type ValidationResultCollector
- func NewCloudStorageResultCollector(client StorageClient, bucketName string, objectName string) (ValidationResultCollector, error)
- func NewConsoleJSONResultCollector(output *Output) ValidationResultCollector
- func NewConsoleResultCollector(output *Output) ValidationResultCollector
- func NewJSONResultToCustomWriterCollector(filename string, writer FileWriter) ValidationResultCollector
- func NewJSONResultToFileCollector(filename string) ValidationResultCollector
- func NewPubSubResultCollector(client PubSubClient, project string, topic string) ValidationResultCollector
- func NewSccCollector(ctx context.Context, orgNumber string, createSource bool, credsFile string) (ValidationResultCollector, error)
Constants ¶
View Source
const ( IconMagnifier = "\U0001f50e" IconInfo = "\u2139" IconHyperlink = "\U0001F517" IconMiddleDot = "\u00b7" )
View Source
const ( SeverityCritical = 4 SeverityHigh = 3 SeverityMedium = 2 SeverityLow = 1 SeverityUnknown = 0 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClusterDumpCollector ¶ added in v1.1.0
func NewFileClusterDumpCollector ¶ added in v1.1.0
func NewFileClusterDumpCollector(filename string) ClusterDumpCollector
func NewOutputClusterDumpCollector ¶ added in v1.1.0
func NewOutputClusterDumpCollector(output *Output) ClusterDumpCollector
type DocumentationBuilder ¶ added in v1.2.0
type DocumentationBuilder func(policies []*policy.Policy) PolicyDocumentation
type FileWriter ¶
type JSONResultCollector ¶
type JSONResultCollector struct {
// contains filtered or unexported fields
}
func (*JSONResultCollector) Close ¶
func (p *JSONResultCollector) Close() error
func (*JSONResultCollector) Name ¶ added in v1.2.0
func (p *JSONResultCollector) Name() string
func (*JSONResultCollector) RegisterResult ¶
func (p *JSONResultCollector) RegisterResult(results []*policy.PolicyEvaluationResult) error
type MarkdownPolicyDocumentation ¶ added in v1.2.0
type MarkdownPolicyDocumentation struct {
// contains filtered or unexported fields
}
func (*MarkdownPolicyDocumentation) GenerateDocumentation ¶ added in v1.2.0
func (m *MarkdownPolicyDocumentation) GenerateDocumentation() string
type OSFileWriter ¶
type OSFileWriter struct { }
type Output ¶
type Output struct {
// contains filtered or unexported fields
}
func NewSilentOutput ¶
func NewSilentOutput() *Output
func NewStdOutOutput ¶
func NewStdOutOutput() *Output
func (*Output) ErrorPrint ¶
type PolicyDocumentation ¶ added in v1.2.0
type PolicyDocumentation interface {
GenerateDocumentation() string
}
func NewMarkdownPolicyDocumentation ¶ added in v1.2.0
func NewMarkdownPolicyDocumentation(policies []*policy.Policy) PolicyDocumentation
type PubSubClient ¶
type StorageClient ¶
type ValidationReport ¶ added in v1.2.0
type ValidationReport struct { ValidationTime time.Time `json:"validationDate"` Policies []*ValidationReportPolicy `json:"policies"` ClusterStats []*ValidationReportClusterStats `json:"statistics"` }
type ValidationReportClusterEvaluation ¶ added in v1.2.0
type ValidationReportClusterStats ¶ added in v1.2.0
type ValidationReportClusterStats struct { ClusterID string `json:"cluster"` ValidPoliciesCount int `json:"validPoliciesCount"` ViolatedPoliciesCount int `json:"violatedPoliciesCount"` ErroredPoliciesCount int `json:"erroredPoliciesCount"` ViolatedCriticalCount int `json:"violatedCriticalCount"` ViolatedHighCount int `json:"violatedHighCount"` ViolatedMediumCount int `json:"violatedMediumCount"` ViolatedLowCount int `json:"violatedLowCount"` }
type ValidationReportMapper ¶ added in v1.2.0
type ValidationReportMapper interface { AddResult(result *policy.PolicyEvaluationResult) AddResults(results []*policy.PolicyEvaluationResult) GetReport() *ValidationReport GetJSONReport() ([]byte, error) }
func NewValidationReportMapper ¶ added in v1.2.0
func NewValidationReportMapper() ValidationReportMapper
type ValidationReportPolicy ¶ added in v1.2.0
type ValidationReportPolicy struct { PolicyName string `json:"name"` PolicyGroup string `json:"group"` PolicyTitle string `json:"title"` PolicyDescription string `json:"description"` Recommendation string `json:"recommendation,omitempty"` ExternalURI string `json:"externalURI,omitempty"` Severity string `json:"severity,omitempty"` SeverityNumber int `json:"-"` ClusterEvaluations []*ValidationReportClusterEvaluation `json:"clusters"` }
type ValidationResultCollector ¶
type ValidationResultCollector interface { RegisterResult(results []*policy.PolicyEvaluationResult) error Close() error Name() string }
func NewCloudStorageResultCollector ¶
func NewCloudStorageResultCollector(client StorageClient, bucketName string, objectName string) (ValidationResultCollector, error)
func NewConsoleJSONResultCollector ¶ added in v1.3.0
func NewConsoleJSONResultCollector(output *Output) ValidationResultCollector
func NewConsoleResultCollector ¶
func NewConsoleResultCollector(output *Output) ValidationResultCollector
func NewJSONResultToCustomWriterCollector ¶
func NewJSONResultToCustomWriterCollector(filename string, writer FileWriter) ValidationResultCollector
func NewJSONResultToFileCollector ¶
func NewJSONResultToFileCollector(filename string) ValidationResultCollector
func NewPubSubResultCollector ¶
func NewPubSubResultCollector(client PubSubClient, project string, topic string) ValidationResultCollector
func NewSccCollector ¶ added in v1.2.0
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package pubsub implements Google Cloud Pub Sub client
|
Package pubsub implements Google Cloud Pub Sub client |
Package scc implements Security Command Center client
|
Package scc implements Security Command Center client |
Package storage implements Google Cloud Storage client
|
Package storage implements Google Cloud Storage client |
Click to show internal directories.
Click to hide internal directories.