Documentation ¶
Index ¶
- Variables
- func StrArrReplace(spl string, arr, rarr []string) []string
- type CmdHelper
- func (c *CmdHelper) CliRunner(name string, input io.Reader, args ...string) (string, error)
- func (c *CmdHelper) CliRunnerChan(name string, input io.Reader, singnal chan<- *exec.Cmd, args ...string) (string, error)
- func (c *CmdHelper) Format(cmdKey, spl string, rarr []string)
- func (c *CmdHelper) GetFormatted(cmdKey, spl string, rarr []string) []string
- func (c *CmdHelper) Run(name string, input io.Reader, cmdKey string) (string, error)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func StrArrReplace ¶
StrArrReplace is to replace an array with a replace array based on a special char rarr(replace array) contains strings that have to be replaced in an order.
Types ¶
type CmdHelper ¶
func (*CmdHelper) CliRunnerChan ¶
func (c *CmdHelper) CliRunnerChan(name string, input io.Reader, singnal chan<- *exec.Cmd, args ...string) (string, error)
CliRunnerChan is to kill long running commands upon a signal. it sends the *exec.Cmd. Receiver channel will receive it and Kill the process based on conditions
func (*CmdHelper) Format ¶
Format formats the command array with a given replace arr. It uses spl (special char) parameter to replace it will update the CommandArgs value with a formatted array
func (*CmdHelper) GetFormatted ¶
GetFormatted formats the command array with a given replace array it uses spl (special char) parameter to replace and then returns an array with all replaced contents this will not update/replace the original array from CommandArgs key