pluginregistry

package
v0.0.0-...-aac4589 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrStepLabelIsMandatory

type ErrStepLabelIsMandatory struct {
	TestStepDescriptor test.TestStepDescriptor
}

func (ErrStepLabelIsMandatory) Error

func (err ErrStepLabelIsMandatory) Error() string

type PluginRegistry

type PluginRegistry struct {
	Context xcontext.Context

	// TargetManagers collects a mapping of Plugin Name <-> TargetManager constructor
	TargetManagers map[string]target.TargetManagerFactory

	// TestFetchers collects a mapping of Plugin Name <-> TestFetchers constructor
	TestFetchers map[string]test.TestFetcherFactory

	// TestStep collects a mapping of Plugin Name <-> TestStep constructor
	TestSteps map[string]test.TestStepFactory

	// TestStepEvents collects a mapping between TestStep and list of event.Name
	// that the TestStep is allowed to emit at runtime
	TestStepsEvents map[string]map[event.Name]bool

	// Reporters collects a mapping of Plugin Name <-> Reporter constructor
	Reporters map[string]job.ReporterFactory
	// contains filtered or unexported fields
}

PluginRegistry manages all the plugins available in the system. It associates Plugin identifiers (implemented as simple strings) with factory functions that create instances of those plugins. A Plugin instance is owner by a single Job object.

func NewPluginRegistry

func NewPluginRegistry(ctx xcontext.Context) *PluginRegistry

NewPluginRegistry constructs a new empty plugin registry

func (*PluginRegistry) NewFinalReporterBundle

func (r *PluginRegistry) NewFinalReporterBundle(reporterName string, reporterParameters []byte) (*job.ReporterBundle, error)

NewFinalReporterBundle creates a Reporter and associated final reporting parameters based on the content of the job descriptor

func (*PluginRegistry) NewReporter

func (r *PluginRegistry) NewReporter(pluginName string) (job.Reporter, error)

NewReporter returns a new instance of a Reporter from its corresponding name

func (*PluginRegistry) NewRunReporterBundle

func (r *PluginRegistry) NewRunReporterBundle(reporterName string, reporterParameters []byte) (*job.ReporterBundle, error)

NewRunReporterBundle creates a Reporter and associated run reporting parameters based on the content of the job descriptor

func (*PluginRegistry) NewTargetManager

func (r *PluginRegistry) NewTargetManager(pluginName string) (target.TargetManager, error)

NewTargetManager returns a new instance of TargetManager from its corresponding name

func (*PluginRegistry) NewTargetManagerBundle

func (r *PluginRegistry) NewTargetManagerBundle(testDescriptor *test.TestDescriptor) (*target.TargetManagerBundle, error)

NewTargetManagerBundle creates a TargetManager and associated parameters based on the content of the test descriptor

func (*PluginRegistry) NewTestFetcher

func (r *PluginRegistry) NewTestFetcher(pluginName string) (test.TestFetcher, error)

NewTestFetcher returns a new instance of TestFetcher from its corresponding name

func (*PluginRegistry) NewTestFetcherBundle

func (r *PluginRegistry) NewTestFetcherBundle(ctx xcontext.Context, testDescriptor *test.TestDescriptor) (*test.TestFetcherBundle, error)

NewTestFetcherBundle creates a TestFetcher and associated parameters based on the content of the job descriptor

func (*PluginRegistry) NewTestStep

func (r *PluginRegistry) NewTestStep(pluginName string) (test.TestStep, error)

NewTestStep returns a new instance of a TestStep from its corresponding name

func (*PluginRegistry) NewTestStepBundle

func (r *PluginRegistry) NewTestStepBundle(ctx xcontext.Context, testStepDescriptor test.TestStepDescriptor) (*test.TestStepBundle, error)

NewTestStepBundle creates a TestStepBundle from a TestStepDescriptor

func (*PluginRegistry) NewTestStepEvents

func (r *PluginRegistry) NewTestStepEvents(pluginName string) (map[event.Name]bool, error)

NewTestStepEvents returns a map of events.EventName which can be emitted by the TestStep

func (*PluginRegistry) RegisterReporter

func (r *PluginRegistry) RegisterReporter(pluginName string, rf job.ReporterFactory) error

RegisterReporter registers a Reporter within the registry

func (*PluginRegistry) RegisterTargetManager

func (r *PluginRegistry) RegisterTargetManager(pluginName string, tmf target.TargetManagerFactory) error

RegisterTargetManager register a factory for TargetManager plugins

func (*PluginRegistry) RegisterTestFetcher

func (r *PluginRegistry) RegisterTestFetcher(pluginName string, tff test.TestFetcherFactory) error

RegisterTestFetcher registers a TestFetcher within the registry

func (*PluginRegistry) RegisterTestStep

func (r *PluginRegistry) RegisterTestStep(pluginName string, tsf test.TestStepFactory, stepEvents []event.Name) error

RegisterTestStep registers a TestStep within the registry and the associated events

Jump to

Keyboard shortcuts

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