exec

package
v0.0.0-...-27de893 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HostCmd

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

HostCmd allows to run a command on the host By default, when the command is run it does not print any output generated during execution. See Silent, Stdin, RunWithEcho, RunAndCapture, Skip and DryRun for possible variations to the default behavior.

func NewHostCmd

func NewHostCmd(command string, args ...string) *HostCmd

NewHostCmd returns a new HostCmd to run a command on a host

func (*HostCmd) Run

func (c *HostCmd) Run() error

Run execute the inner command on a kind(er) node

func (*HostCmd) RunAndCapture

func (c *HostCmd) RunAndCapture() (lines []string, err error)

RunAndCapture executes the inner command on a kind(er) node and return the output captured during execution

func (*HostCmd) RunWithEcho

func (c *HostCmd) RunWithEcho() error

RunWithEcho execute the inner command on a kind(er) node and echoes the command output to screen

func (*HostCmd) SetEnv

func (c *HostCmd) SetEnv(env ...string) *HostCmd

SetEnv sets env variables to be used when running the inner command

func (*HostCmd) Stdin

func (c *HostCmd) Stdin(in io.Reader) *HostCmd

Stdin sets an io.Reader to be used for streaming data in input to the inner command

type NodeCmd

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

NodeCmd allows to run a command on a kind(er) node

by default the command is printed to stdout before execution; to enable colorized print of the
command text, that can help in debugging, please set the KINDER_COLORS environment variable to ON.

By default, when the command is run it does not print any output generated during execution. See Silent, Stdin, RunWithEcho, RunAndCapture, Skip and DryRun for possible variations to the default behavior.

func NewNodeCmd

func NewNodeCmd(node, command string, args ...string) *NodeCmd

NewNodeCmd returns a new ProxyCmd to run a command on a kind(er) node

func (*NodeCmd) DryRun

func (c *NodeCmd) DryRun() *NodeCmd

DryRun instruct the proxy command to print the inner command text instead of running it.

func (*NodeCmd) Run

func (c *NodeCmd) Run() error

Run execute the inner command on a kind(er) node

func (*NodeCmd) RunAndCapture

func (c *NodeCmd) RunAndCapture() (lines []string, err error)

RunAndCapture executes the inner command on a kind(er) node and return the output captured during execution

func (*NodeCmd) RunWithEcho

func (c *NodeCmd) RunWithEcho() error

RunWithEcho execute the inner command on a kind(er) node and echoes the command output to screen

func (*NodeCmd) Silent

func (c *NodeCmd) Silent() *NodeCmd

Silent instructs the proxy command to not the command text to stdout before execution

func (*NodeCmd) Stdin

func (c *NodeCmd) Stdin(in io.Reader) *NodeCmd

Stdin sets an io.Reader to be used for streaming data in input to the inner command

Directories

Path Synopsis
Package colors implement utilities for colorizing prompt, command and args printed to screen before execution.
Package colors implement utilities for colorizing prompt, command and args printed to screen before execution.

Jump to

Keyboard shortcuts

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