workflow

package
v0.0.0-...-6cd82ae Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AzdCommandRunner

type AzdCommandRunner interface {
	SetArgs(args []string)
	ExecuteContext(ctx context.Context) error
}

AzdCommandRunner abstracts the execution of an azd command given an set of arguments and context.

type Command

type Command struct {
	Args []string `yaml:"args,omitempty"`
}

Command stores a single command to execute

func (*Command) UnmarshalYAML

func (c *Command) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML will unmarshal the Command from YAML. In command YAML the command can be specified as a simple string or a more verbose map/struct style

type Runner

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

Runner is responsible for executing a workflow

func NewRunner

func NewRunner(azdRunner AzdCommandRunner, console input.Console) *Runner

NewRunner creates a new instance of the Runner.

func (*Runner) Run

func (r *Runner) Run(ctx context.Context, workflow *Workflow) error

Run executes the specified workflow against the root cobra command

type Step

type Step struct {
	AzdCommand Command `yaml:"azd,omitempty"`
}

Step stores a single step to execute within a workflow This struct can be expanded over time to support other types of steps/commands

func NewAzdCommandStep

func NewAzdCommandStep(args ...string) *Step

NewAzdCommandStep creates a new step that executes an azd command with the specified name and args

type Workflow

type Workflow struct {
	Name  string  `yaml:"-"`
	Steps []*Step `yaml:"steps,omitempty"`
}

Workflow stores a list of steps to execute

func (*Workflow) UnmarshalYAML

func (w *Workflow) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML will unmarshal the Workflow from YAML. The workflow YAML can be specified as either a simple array of steps or a more verbose map/struct style

type WorkflowMap

type WorkflowMap map[string]*Workflow

Stores a map of workflows configured for an azd project

func (*WorkflowMap) UnmarshalYAML

func (wm *WorkflowMap) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML will unmarshal the WorkflowMap from YAML. The unmarshalling will marshall the YAML like a standard Go map but will also persist the key as the workflow name within the Workflow struct.

Jump to

Keyboard shortcuts

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