utils

package
v0.1.0-rc0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2021 License: MPL-2.0 Imports: 12 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallCommand

func CallCommand(cmdstr string) ([]byte, error)

CallCommand will run an external command, displaying its output interactively and return its output.

func CallCommandForEffect

func CallCommandForEffect(cmdstr string) error

func CallCommandForEffectWithDebug

func CallCommandForEffectWithDebug(cmdstr string) error

func CallCommandForEffectWithInputPipe

func CallCommandForEffectWithInputPipe(cmdstr, input string) error

func CallCommandForEffectWithInputPipeAndDebug

func CallCommandForEffectWithInputPipeAndDebug(cmdstr, input string) error

func CallCommandSeparatingOutputStreams

func CallCommandSeparatingOutputStreams(cmdstr string) ([]byte, []byte, error)

func CallCommandSilently

func CallCommandSilently(cmdstr string) ([]byte, error)

func CaptureStdout added in v0.1.0

func CaptureStdout(c callback) string

func Escape

func Escape(cmd string) string

func Exists added in v0.0.4

func Exists(filePath string) bool

func OverrideBehavior added in v0.0.4

func OverrideBehavior(callOp CallOperation, behavior func(args ...interface{}) ([]byte, []byte, error)) override.Override

func OverrideFailure added in v0.0.4

func OverrideFailure(callOp CallOperation) override.Override

func OverrideIgnore added in v0.0.4

func OverrideIgnore(callOp CallOperation) override.Override

func WaitUntil added in v0.0.4

func WaitUntil(out io.Writer, poll, timeout time.Duration, checkDone func() error) error

WaitUntil runs checkDone until a timeout is reached

func WithBehaviorFor added in v0.0.3

func WithBehaviorFor(callOp CallOperation, behavior func(args ...interface{}) ([]byte, []byte, error), action func() ([]byte, []byte, error)) ([]byte, []byte, error)

func WithResultsFrom added in v0.0.3

func WithResultsFrom(callOp CallOperation, outvalue []byte, errvalue []byte, err error, action func() ([]byte, []byte, error)) ([]byte, []byte, error)

Types

type CallOperation added in v0.0.3

type CallOperation int
const (
	CallCommandOp CallOperation = iota
	CallCommandSilentlyOp
	CallCommandSeparatingOutputStreamsOp
	CallCommandForEffectOp
	CallCommandForEffectWithDebugOp
	CallCommandForEffectWithInputPipeOp
	CallCommandForEffectWithInputPipeAndDebugOp
)

Jump to

Keyboard shortcuts

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