example

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StartedEvent  = event.Name("ExampleStartedEvent")
	FinishedEvent = event.Name("ExampleFinishedEvent")
	FailedEvent   = event.Name("ExampleFailedEvent")
)

events that we may emit during the plugin's lifecycle. This is used in Events below. Note that you don't normally need to emit start/finish/cancellation events as these are emitted automatically by the framework.

View Source
const (
	// Fail this percentage of targets at random.
	FailPctParam = "FailPct"
)

Params this step accepts.

Variables

Events defines the events that a TestStep is allow to emit. Emitting an event that is not registered here will cause the plugin to terminate with an error.

View Source
var Name = "Example"

Name is the name used to look this plugin up.

Functions

func Load

func Load() (string, test.TestStepFactory, []event.Name)

Load returns the name, factory and events which are needed to register the step.

func New

func New() test.TestStep

New initializes and returns a new ExampleTestStep.

Types

type Step

type Step struct {
	// contains filtered or unexported fields
}

Step is an example implementation of a TestStep which simply consumes Targets in input and pipes them to the output or error channel with intermediate buffering.

func (Step) Name

func (ts Step) Name() string

Name returns the name of the Step

func (*Step) Run

Run executes the example step.

func (*Step) ValidateParameters

func (ts *Step) ValidateParameters(_ xcontext.Context, params test.TestStepParameters) error

ValidateParameters validates the parameters associated to the TestStep

Jump to

Keyboard shortcuts

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