pluginkit

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2025 License: Apache-2.0 Imports: 16 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Armory

type Armory struct {
	PluginName    string               // PluginName is the name of the plugin
	ServiceTarget string               // ServiceTarget is the name of the service the plugin is running on
	Config        *config.Config       // Config is the global configuration for the plugin
	Logger        hclog.Logger         // Logger is the global logger for the plugin
	TestSuites    map[string][]TestSet // TestSuites is a map of testSuite names to their testSets
	StartupFunc   func() error         // StartupFunc is a function to run before the testSets
	CleanupFunc   func() error         // CleanupFunc is a function to run after the testSets
}

type TestSet

type TestSet func() (result layer4.ControlEvaluation)

type TestSuite

type TestSuite struct {
	TestSuiteName string // TestSuiteName is the name of the TestSuite
	Start_Time    string // Start_Time is the time the plugin started
	End_Time      string // End_Time is the time the plugin ended
	Passed        bool   // Passed is true if all testSets in the testSuite passed
	BadStateAlert bool   // BadState is true if any testSet failed to revert at the end of the testSuite

	Control_Evaluations map[string]layer4.ControlEvaluation // Control_Evaluations is a map of testSet names to their results
	// contains filtered or unexported fields
}

TestSuite is a struct that contains the results of all testSets, orgainzed by name

func (*TestSuite) AddControlEvaluation added in v0.8.0

func (t *TestSuite) AddControlEvaluation(name string, result layer4.ControlEvaluation)

AddControlEvaluation adds a layer4.ControlEvaluation to the TestSuite

func (*TestSuite) Execute

func (t *TestSuite) Execute() error

Execute is used to execute a list of testSets provided by a Plugin and customized by user config

func (*TestSuite) WriteControlEvaluations added in v0.8.0

func (t *TestSuite) WriteControlEvaluations(serviceName string, output string) error

type Vessel

type Vessel struct {
	ServiceName  string
	PluginName   string
	RequiredVars []string
	Armory       *Armory
	TestSuites   []TestSuite
	Initializer  func(*config.Config) error
	// contains filtered or unexported fields
}

The vessel gets the armory in position to execute the testSets specified in the testSuites

func NewVessel

func NewVessel(
	name string,
	armory *Armory,
	initializer func(*config.Config) error,
	requiredVars []string) Vessel

func (*Vessel) Mobilize

func (v *Vessel) Mobilize() (err error)

Mobilize executes the testSets specified in the testSuites

func (*Vessel) StockArmory

func (v *Vessel) StockArmory() error

StockArmory sets up the armory for the vessel to use

Jump to

Keyboard shortcuts

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