Documentation
¶
Index ¶
- func AddPlugin(name string, plugin PluginInterface)
- func RunSample(ctx context.Context, sample *config.SampleConfig) (context.Context, []*metrics.Metric, []*report.Report, error)
- func RunWithVariables(ctx context.Context, variables map[string]string, sample *config.SampleConfig) (context.Context, []*metrics.Metric, *report.Report, error)
- type BasePlugin
- type ContextGenerator
- type PluginInterface
- type Step
- type StepDefinition
- type StepParam
- type StepParamTemplate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BasePlugin ¶
type BasePlugin struct {
StepDefinitions map[string]*StepDefinition
}
BasePlugin represents a base plugin.
func (*BasePlugin) Primitives ¶
func (p *BasePlugin) Primitives()
Primitives initializes the plugin.
func (*BasePlugin) RegisterStep ¶
func (p *BasePlugin) RegisterStep(step *StepDefinition)
RegisterStep registers a step.
func (*BasePlugin) RunStep ¶
func (p *BasePlugin) RunStep(ctx context.Context, step *Step) (context.Context, []*metrics.Metric, error)
RunStep runs a step.
func (*BasePlugin) StepExists ¶
func (p *BasePlugin) StepExists(name string) bool
StepExists returns true if the step exists.
type ContextGenerator ¶
type ContextGenerator struct { // Name is the name of the context generator. Name string // Description is the description of the context generator. Description string }
ContextGenerator represents a context generator.
type PluginInterface ¶
type PluginInterface interface { // Init initializes the plugin. Init() // Primitives returns the plugin primitives. Primitives() // RunStep runs a step. RunStep(context.Context, *Step) (context.Context, []*metrics.Metric, error) // RegisterStep registers a step. RegisterStep(*StepDefinition) // StepExists returns true if the step exists. StepExists(string) bool }
PluginInterface represents a plugin.
type Step ¶
type Step struct { // Name is the name of the step. Name string // Args is the arguments of the step. Args map[string]string // Timeout is the timeout of the step. Timeout int // Negate is true if the step should be negated. Negate bool }
Step represents a step.
type StepDefinition ¶
type StepDefinition struct { Name string Description string Params []StepParam Fn stepFn `json:"-"` ContextGenerator []ContextGenerator }
StepDefinition represents a step definition.
type StepParamTemplate ¶
type StepParamTemplate struct { Env map[string]string Date time.Time Context context.Context Variables map[string]string }
StepParamTemplate represents a step parameter template.
func (*StepParamTemplate) GetContext ¶
func (s *StepParamTemplate) GetContext(key string) string
GetContext return context value by key
Click to show internal directories.
Click to hide internal directories.