cmd

package
v0.6.4-154-g3fa550d Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2023 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cmd

type Cmd struct {
	*exec.Cmd
}

Cmd is a wrapper around exec.Cmd with sensible handling of stderr in error reports.

func NewKraft

func NewKraft(stdout, stderr *IOStream, cfgPath string) *Cmd

NewKraft returns a kraft OS command that uses the given IO streams and has pre-set flags to use the given paths.

func (*Cmd) Run

func (c *Cmd) Run() error

Run runs the command, and automatically injects the output to stderr in the returned ExitError, in case such an error occurs. It is similar to (*exec.Cmd).Output, but allows the command to have stdout explicitly set.

type ExitError

type ExitError struct {
	*exec.ExitError
}

ExitError is a wrapper around exec.ExitError that can be pretty-printed through a gomega matcher.

func (*ExitError) GomegaString

func (e *ExitError) GomegaString() string

type IOStream

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

IOStream represents an IO stream to be used by OS commands and suitable for assertions and reporting in tests.

func NewIOStream

func NewIOStream() *IOStream

NewIOStream returns an initialized IOStream.

func (*IOStream) GomegaString

func (s *IOStream) GomegaString() string

func (*IOStream) Read

func (s *IOStream) Read(p []byte) (n int, err error)

func (*IOStream) String

func (s *IOStream) String() string

func (*IOStream) Write

func (s *IOStream) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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