oshelpers

package
v8.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandWrapper

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

func Command

func Command(command string, args ...string) *CommandWrapper

func (*CommandWrapper) OutputWriter

func (c *CommandWrapper) OutputWriter(outputWriter io.Writer) *CommandWrapper

func (*CommandWrapper) Run

func (c *CommandWrapper) Run() error

func (*CommandWrapper) RunAndGetOutput

func (c *CommandWrapper) RunAndGetOutput() (string, error)

func (*CommandWrapper) ShowOutput

func (c *CommandWrapper) ShowOutput(value bool) *CommandWrapper

func (*CommandWrapper) WorkingDir

func (c *CommandWrapper) WorkingDir(workDir DirPath) *CommandWrapper

type DirPath

type DirPath string

type LineParsingWriter

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

LineParsingWriter is a Writer that buffers output by line, and calls the specified function for each line.

func NewLineParsingWriter

func NewLineParsingWriter(outputFn func(string)) *LineParsingWriter

NewLineParsingWriter creates a LineParsingWriter.

func NewLogWriter

func NewLogWriter(dest io.Writer, logPrefix string) *LineParsingWriter

NewLogWriter returns a LineParsingWriter that writes to log.Println with the specified prefix.

func (*LineParsingWriter) Close

func (w *LineParsingWriter) Close()

Close closes the writer.

func (*LineParsingWriter) Flush

func (w *LineParsingWriter) Flush()

Flush writes any buffered incomplete line.

func (*LineParsingWriter) Write

func (w *LineParsingWriter) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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