Documentation
¶
Overview ¶
errors.go contains error definitions to streamline testing and log management
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( CORRUPTION_FOUND = func() error { return errors.New("target state may be corrupted! Halting to prevent futher damage. See logs for more information") } NO_EVALUATION_SUITES = func() error { return errors.New("no control evaluations provided by the plugin") } EVAL_NAME_MISSING = func() error { return errors.New("evaluationSuite name must not be empty") } )
Errors with no parameters
View Source
var ( VESSEL_NAMES_NOT_SET = func(serviceName, pluginName string) error { return fmt.Errorf("expected service and plugin names to be set. ServiceName='%s' PluginName='%s'", serviceName, pluginName) } EVALUATION_ORCHESTRATOR_NAMES_NOT_SET = func(serviceName, pluginName string) error { return fmt.Errorf("expected service and plugin names to be set. ServiceName='%s' PluginName='%s'", serviceName, pluginName) } WRITE_FAILED = func(name, err string) error { return fmt.Errorf("failed to write results for evaluation suite. name: %s, error: %s", name, err) } BAD_LOADER = func(pluginName string, err error) error { return fmt.Errorf("failed to load payload for %s: %s", pluginName, err) } )
Errors with parameters required
Functions ¶
This section is empty.
Types ¶
type DataLoader ¶ added in v1.0.1
type EvaluationOrchestrator ¶ added in v1.3.0
type EvaluationOrchestrator struct {
ServiceName string `yaml:"service-name"`
PluginName string `yaml:"plugin-name"`
PluginUri string `yaml:"plugin-uri"`
PluginVersion string `yaml:"plugin-version"`
Payload interface{}
Evaluation_Suites []*EvaluationSuite `yaml:"evaluation-suites"` // EvaluationSuite is a map of evaluations to their catalog names
// contains filtered or unexported fields
}
The evaluation orchestrator gets the plugin in position to execute the specified evaluation suites
func NewEvaluationOrchestrator ¶ added in v1.3.0
func NewEvaluationOrchestrator(pluginName string, loader DataLoader, requiredVars []string) *EvaluationOrchestrator
func (*EvaluationOrchestrator) AddEvaluationSuite ¶ added in v1.3.0
func (v *EvaluationOrchestrator) AddEvaluationSuite(catalogId string, loader DataLoader, evaluations []*layer4.ControlEvaluation, requirements map[string]*layer2.AssessmentRequirement)
func (*EvaluationOrchestrator) Mobilize ¶ added in v1.3.0
func (v *EvaluationOrchestrator) Mobilize() error
func (*EvaluationOrchestrator) WriteResults ¶ added in v1.3.0
func (v *EvaluationOrchestrator) WriteResults() error
type EvaluationSuite ¶ added in v1.0.0
type EvaluationSuite struct {
Name string // Name is the name of the suite
Result layer4.Result // Result is Passed if all evaluations in the suite passed
CatalogId string `yaml:"catalog-id"` // CatalogId associates this suite with an catalog
StartTime string `yaml:"start-time"` // StartTime is the time the plugin started
EndTime string `yaml:"end-time"` // EndTime is the time the plugin ended
CorruptedState bool `yaml:"corrupted-state"` // BadState is true if any testSet failed to revert at the end of the evaluation
EvaluationLog layer4.EvaluationLog `yaml:"control-evaluations"` // EvaluationLog is a slice of evaluations to be executed
// contains filtered or unexported fields
}
TestSuite is a struct that contains the results of all EvaluationLog, organized by name
func (*EvaluationSuite) Evaluate ¶ added in v1.0.0
func (e *EvaluationSuite) Evaluate(name string) error
Execute is used to execute a list of EvaluationLog provided by a Plugin and customized by user config Name is an arbitrary string that will be used to identify the EvaluationSuite
type PayloadTypeExample ¶ added in v1.0.0
type PayloadTypeExample struct {
CustomPayloadField bool
}
type TestSet ¶
type TestSet func() (result layer4.ControlEvaluation)
Click to show internal directories.
Click to hide internal directories.