runner

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package runner implements method to run commands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RealRunner

type RealRunner struct {
	DryRun bool
	// contains filtered or unexported fields
}

RealRunner runs actual os commands. Tests can define a mocked alternative.

func (*RealRunner) Clean

func (r *RealRunner) Clean() error

Clean kills running processes.

func (*RealRunner) MkdirAll

func (r *RealRunner) MkdirAll(dir string) error

MkdirAll calls MkdirAll.

func (*RealRunner) Run

func (r *RealRunner) Run(ctx context.Context, args []string, in io.Reader, out, err io.Writer, dir string) error

Run runs a command.

func (*RealRunner) WriteFile

func (r *RealRunner) WriteFile(path, contents string) error

WriteFile writes a text file to disk.

type Runner

type Runner interface {
	Run(ctx context.Context, args []string, in io.Reader, out, err io.Writer, dir string) error
	MkdirAll(dir string) error
	WriteFile(path, contents string) error
	Clean() error
}

Runner is a mockable interface for running os commands.

Jump to

Keyboard shortcuts

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