Help us shape the future of Go! Take the 2026 Go Developer Survey

engine

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine struct {
	Configuration EngineConfiguration
}

func NewEngine

func NewEngine(configuration EngineConfiguration) (*Engine, error)

/ Create a new engine instance.

func (*Engine) ExecuteAndRenderSteps

func (e *Engine) ExecuteAndRenderSteps(steps []Step, env map[string]string) error

Executes the steps from a scenario and renders the output to the terminal.

func (*Engine) ExecuteScenario

func (e *Engine) ExecuteScenario(scenario *Scenario) error

Executes a deployment scenario.

func (*Engine) TestScenario

func (e *Engine) TestScenario(scenario *Scenario) error

Validates a deployment scenario.

func (*Engine) TestSteps

func (e *Engine) TestSteps(steps []Step, env map[string]string) error

type EngineConfiguration

type EngineConfiguration struct {
	Verbose          bool
	DoNotDelete      bool
	CorrelationId    string
	Subscription     string
	Environment      string
	WorkingDirectory string
	RenderValues     bool
}

Configuration for the engine.

type Scenario

type Scenario struct {
	Name        string
	MarkdownAst ast.Node
	Steps       []Step
	Environment map[string]string
}

Scenarios are the top-level object that represents a scenario to be executed.

func CreateScenarioFromMarkdown

func CreateScenarioFromMarkdown(
	path string,
	languagesToExecute []string,
	environmentVariableOverrides map[string]string,
) (*Scenario, error)

Creates a scenario object from a given markdown file. languagesToExecute is used to filter out code blocks that should not be parsed out of the markdown file.

func (*Scenario) OverwriteEnvironmentVariables

func (s *Scenario) OverwriteEnvironmentVariables(environmentVariables map[string]string)

func (*Scenario) ToShellScript

func (s *Scenario) ToShellScript() string

Convert a scenario into a shell script

type Step

type Step struct {
	Name       string
	CodeBlocks []parsers.CodeBlock
}

Individual steps within a scenario.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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