Documentation
¶
Index ¶
- func ExecuteCodeBlockAsync(codeBlock parsers.CodeBlock, env map[string]string) tea.Cmd
- func ExecuteCodeBlockSync(codeBlock parsers.CodeBlock, env map[string]string) tea.Msg
- type AzureStatusUpdatedMessage
- type CodeBlockState
- type Engine
- func (e *Engine) ExecuteAndRenderSteps(steps []Step, env map[string]string) error
- func (e *Engine) ExecuteScenario(scenario *Scenario) error
- func (e *Engine) InteractWithScenario(scenario *Scenario) error
- func (e *Engine) TestScenario(scenario *Scenario) error
- func (e *Engine) TestSteps(steps []Step, env map[string]string) error
- type EngineConfiguration
- type FailedCommandMessage
- type InteractiveModeCommands
- type InteractiveModeModel
- type Scenario
- type Step
- type SuccessfulCommandMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecuteCodeBlockAsync ¶ added in v0.1.0
Executes a bash command and returns a tea message with the output. This function will be executed asycnhronously.
Types ¶
type AzureStatusUpdatedMessage ¶ added in v0.1.0
type AzureStatusUpdatedMessage struct{}
Empty struct used to indicate that the azure status has been updated so that we can respond to it within the Update() function.
type CodeBlockState ¶ added in v0.1.0
type CodeBlockState struct {
CodeBlock parsers.CodeBlock
CodeBlockNumber int
Error error
StdErr string
StdOut string
StepName string
StepNumber int
Success bool
}
State for the codeblock in interactive mode. Used to keep track of the state of each codeblock.
type Engine ¶
type Engine struct {
Configuration EngineConfiguration
}
func NewEngine ¶
func NewEngine(configuration EngineConfiguration) (*Engine, error)
/ Create a new engine instance.
func (*Engine) ExecuteAndRenderSteps ¶
Executes the steps from a scenario and renders the output to the terminal.
func (*Engine) ExecuteScenario ¶
Executes a deployment scenario.
func (*Engine) InteractWithScenario ¶ added in v0.1.0
Executes a Scenario in interactive mode. This mode goes over each codeblock step by step and allows the user to interact with the codeblock.
func (*Engine) TestScenario ¶
Validates a deployment scenario.
type EngineConfiguration ¶
type EngineConfiguration struct {
Verbose bool
DoNotDelete bool
CorrelationId string
Subscription string
Environment string
WorkingDirectory string
RenderValues bool
}
Configuration for the engine.
type FailedCommandMessage ¶ added in v0.1.0
Emitted when a command has failed to execute.
type InteractiveModeCommands ¶ added in v0.1.0
type InteractiveModeCommands struct {
// contains filtered or unexported fields
}
type InteractiveModeModel ¶ added in v0.1.0
type InteractiveModeModel struct {
// contains filtered or unexported fields
}
func NewInteractiveModeModel ¶ added in v0.1.0
func NewInteractiveModeModel( title string, engine *Engine, steps []Step, env map[string]string, ) (InteractiveModeModel, error)
Create a new interactive mode model.
func (InteractiveModeModel) Init ¶ added in v0.1.0
func (model InteractiveModeModel) Init() tea.Cmd
Initialize the intractive mode model
func (InteractiveModeModel) View ¶ added in v0.1.0
func (model InteractiveModeModel) View() string
Renders the interactive mode model.
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) ToShellScript ¶
Convert a scenario into a shell script
type SuccessfulCommandMessage ¶ added in v0.1.0
Emitted when a command has been executed successfully.