steps

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CatchStep

type CatchStep struct {
	Func func(error) error
}

CatchStep handles catching errors from any preceding steps.

func (CatchStep) Run

func (s CatchStep) Run(r Result) chan Result

Run runs the catch's function.

type ChdirStep

type ChdirStep struct {
	Path string
}

ChdirStep handles changing the current working directory.

func (ChdirStep) Run

func (s ChdirStep) Run(pr Result) chan Result

Run changes the working directory.

type Context

type Context interface {
	AddProcessKillChannel(chan Result)
	RemoveProcessKillChannel(chan Result)
	GetProcessKillChannels() []chan Result
	GetEnv() []string
	AddEnv(...string)
	RunTask(string) chan Result
	WorkingDirectory() string
	SetWorkingDirectory(string)
	UpdateWorkingDirectory(string)
}

Context is an interface to Context.

type EndStep added in v0.3.0

type EndStep struct {
}

EndStep represents the end of a prompt.

func (EndStep) Run added in v0.3.0

func (s EndStep) Run(r Result) chan Result

Run just returns an empty result.

type EnvStep

type EnvStep struct {
	Args []string
}

EnvStep sets up environment variables to use.

func (EnvStep) Run

func (s EnvStep) Run(pr Result) chan Result

Run adds the env var to the task.

type ExecStep

type ExecStep struct {
	Args []interface{}
}

ExecStep handles executing a command.

func (ExecStep) Run

func (s ExecStep) Run(pr Result) chan Result

Run runs a command.

type ExistsStep

type ExistsStep struct {
	Path string
}

ExistsStep handles checking if a directory or file exists.

func (ExistsStep) Run

func (s ExistsStep) Run(pr Result) chan Result

Run checks if the file or folder exists and returns an fs.FileInfo.

type NoStep added in v0.3.0

type NoStep struct {
}

NoStep represents the beginning of a no response to a prompt.

func (NoStep) Run added in v0.3.0

func (s NoStep) Run(r Result) chan Result

Run returns false in the result.

type ParallelStep added in v0.2.0

type ParallelStep struct {
	TaskNames []string
}

ParallelStep runs tasks in parallel.

func (ParallelStep) Run added in v0.2.0

func (s ParallelStep) Run(r Result) chan Result

Run uses wait groups.

type PrintStep added in v0.3.0

type PrintStep struct {
	Args []interface{}
}

PrintStep handles printing passed arguments or the results of the previous step if no arguments are passed.

func (PrintStep) Run added in v0.3.0

func (s PrintStep) Run(r Result) chan Result

Run prints the contents of the print step.

type PromptStep added in v0.3.0

type PromptStep struct {
	Message string
}

PromptStep handles printing passed arguments or the results of the previous step if no arguments are passed.

func (PromptStep) Run added in v0.3.0

func (s PromptStep) Run(r Result) chan Result

Run prints the contents of the print step.

type Result

type Result struct {
	Result  interface{}
	Error   error
	Context Context
}

Result represents the result of a step.

type ResultStep

type ResultStep struct {
	Func func(interface{})
}

ResultStep handles the result of a previous step.

func (ResultStep) Run

func (s ResultStep) Run(r Result) chan Result

Run calls the step's result function.

type RunStep

type RunStep struct {
	TaskName string
}

RunStep handles Running a new task.

func (RunStep) Run

func (s RunStep) Run(r Result) chan Result

Run begins running a new task.

type SleepStep

type SleepStep struct {
	Duration string
}

SleepStep causes a delay.

func (SleepStep) Run

func (s SleepStep) Run(pr Result) chan Result

Run sleeps for the given delay.

type Step

type Step interface {
	Run(Result) chan Result
}

Step is the interface that all gobl steps adhere to.

type WatchStep

type WatchStep struct {
	Paths []string
}

WatchStep handles setting up watch conditions.

func (WatchStep) Run

func (s WatchStep) Run(r Result) chan Result

Run does nothing.

type YesStep added in v0.3.0

type YesStep struct {
}

YesStep represents the beginning of a yes response to a prompt.

func (YesStep) Run added in v0.3.0

func (s YesStep) Run(r Result) chan Result

Run returns true in the result.

Jump to

Keyboard shortcuts

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