plugin

package
v0.17.3 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterSetup added in v0.9.0

func RegisterSetup(setup SetupFunc)

RegisterSetup registers a function to setup for plugin. Plugins must call this function in their init function if it registers the setup process.

func RegisterSetupEachScenario added in v0.9.0

func RegisterSetupEachScenario(setup SetupFunc)

RegisterSetupEachScenario registers a function to setup for plugin. Plugins must call this function in their init function if it registers the setup process. The registered function will be called before each scenario.

func Setup added in v0.14.0

func Setup(t *testing.T)

Setup calls the registered functions by RegisterSetup.

func SetupEachScenario added in v0.14.0

func SetupEachScenario(t *testing.T)

SetupEachScenario calls the registered functions by RegisterSetupEachScenario.

Types

type Context

type Context = context.Context

Context represents a scenarigo context.

type LeftArrowFunc

type LeftArrowFunc = template.Func

LeftArrowFunc represents a left arrow function.

type Plugin added in v0.9.0

type Plugin interface {
	Lookup(name string) (Symbol, error)
	GetSetup() SetupFunc
	GetSetupEachScenario() SetupFunc
}

Plugin represents a scenarigo plugin.

func Open added in v0.9.0

func Open(path string) (Plugin, error)

Open opens a Go plugin. If a path has already been opened, then the existing *Plugin is returned. It is safe for concurrent use by multiple goroutines.

type SetupFunc added in v0.9.0

type SetupFunc func(ctx *Context) (newCtx *Context, teardown func(*Context))

SetupFunc represents a setup function. If it returns non-nil teardown, the function will be called later.

type Step

type Step interface {
	Run(*context.Context, *schema.Step) *context.Context
}

Step represents a step plugin.

type StepFunc

type StepFunc func(ctx *context.Context, step *schema.Step) *context.Context

StepFunc is an adaptor to allow the use of ordinary functions as step.

func (StepFunc) Run

func (f StepFunc) Run(ctx *context.Context, step *schema.Step) *context.Context

Run implements Step interface.

type Symbol added in v0.9.0

type Symbol = plugin.Symbol

Symbol is a pointer to a variable or function.

Jump to

Keyboard shortcuts

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