Back to godoc.org
github.com/jthomperoo/custom-pod-autoscaler/execute/shell

package shell

v0.11.0
Latest Go to latest
Published: Feb 28, 2020 | License: Apache-2.0 | Module: github.com/jthomperoo/custom-pod-autoscaler

Overview

Package shell handles interactions with the OS shell

Index

Constants

const Type = "shell"

Type shell represents a shell command

type Execute

type Execute struct {
	Command command
}

Execute represents a way to execute shell commands with values piped to them.

func (*Execute) ExecuteWithValue

func (e *Execute) ExecuteWithValue(method *config.Method, value string) (string, error)

ExecuteWithValue executes a shell command with a value piped to it. If it exits with code 0, no error is returned and the stdout is captured and returned. If it exits with code 1, an error is returned and the stderr is captured and returned. If the timeout is reached, an error is returned.

func (*Execute) GetType

func (e *Execute) GetType() string

GetType returns the shell executer type

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
f or F : Jump to identifier