Documentation ¶
Index ¶
- Constants
- func Ensure(commands ...string) error
- func MustEnsure(commands ...string)
- func S(s ...string) []string
- type Demo
- type Options
- type Run
- func (r *Run) BreakPoint()
- func (r *Run) Cleanup(cleanupFn func() error)
- func (r *Run) Run(ctx *cli.Context) error
- func (r *Run) RunWithOptions(opts Options) error
- func (r *Run) SetOutput(output io.Writer) error
- func (r *Run) Setup(setupFn func() error)
- func (r *Run) Step(text, command []string)
- func (r *Run) StepCanFail(text, command []string)
Constants ¶
View Source
const ( // FlagAll is the flag for running all demos. FlagAll = "all" // FlagAuto is the flag for running in automatic mode. FlagAuto = "auto" // FlagAutoTimeout is the flag for the timeout to be waited when `auto` is // enabled. FlagAutoTimeout = "auto-timeout" // FlagBreakPoint is the flag for doing`auto` but with breakpoint. FlagBreakPoint = "with-breakpoints" // FlagContinueOnError is the flag for steps continue running if // there is an error. FlagContinueOnError = "continue-on-error" // FlagContinuously is the flag for running the demos continuously without // any end. FlagContinuously = "continuously" // DryRun only prints the command in the stdout. FlagDryRun = "dry-run" // FlagHideDescriptions is the flag for hiding the descriptions. FlagHideDescriptions = "hide-descriptions" // FlagImmediate is the flag for disabling the text animations. FlagImmediate = "immediate" // NoColor true to print without colors, special characters for writing into file. FlagNoColor = "no-color" // FlagSkipSteps is the flag for skipping n amount of steps. FlagSkipSteps = "skip-steps" // FlagShell is the flag for defining the shell that is used to execute the command(s). FlagShell = "shell" )
Variables ¶
This section is empty.
Functions ¶
func Ensure ¶
Ensure executes the provided commands in order. This utility function can be used during setup or cleanup.
func MustEnsure ¶
func MustEnsure(commands ...string)
MustEnsure executes the provided commands in order and panics on failure.
Types ¶
type Demo ¶
type Demo struct { *cli.App // contains filtered or unexported fields }
type Options ¶
type Options struct { AutoTimeout time.Duration Auto bool BreakPoint bool ContinueOnError bool HideDescriptions bool DryRun bool NoColor bool Immediate bool SkipSteps int Shell string }
Options specify the run options.
type Run ¶
type Run struct {
// contains filtered or unexported fields
}
Run is an abstraction for one part of the Demo. A demo can contain multiple runs.
func (*Run) BreakPoint ¶
func (r *Run) BreakPoint()
BreakPoint creates a new step which can fail on execution.
func (*Run) RunWithOptions ¶
RunWithOptions executes the run with the provided Options.
func (*Run) StepCanFail ¶
StepCanFail creates a new step which can fail on execution.
Click to show internal directories.
Click to hide internal directories.