exechelper

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package exechelper streamlines the running of external commands while both capturing and logging their output.

It builds on os/exec, expecting an instance of Cmd to manipulate.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(cmd *exec.Cmd, logger log.FieldLogger, outputLogger OutputLogger) ([]byte, []byte, error)

Run invokes cmd.Run, both logging and returning STDOUT and STDERR, optionally transforming the output first.

Types

type OutputLogger

type OutputLogger func(line string, logger log.FieldLogger)

OutputLogger allows custom logging of the run command output.

Jump to

Keyboard shortcuts

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