plugin

package
v0.13.3-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterSetup

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

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.

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

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

Plugin represents a scenarigo plugin.

func Open

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

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

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