Documentation
¶
Index ¶
Constants ¶
View Source
const ShellToUse = "sh"
ShellToUse bash shell
Variables ¶
This section is empty.
Functions ¶
func CommandParams ¶
CommandParams calculate command params map params inorder to inject prev. command result into next command accept list of commands return location and result
Types ¶
type CmdEvalResult ¶
type CmdEvalResult struct { Match bool CmdEvalExpr string PolicyResult []utils.PolicyResult ReturnKeys []string Error error }
CmdEvalResult command result object
type CmdEvaluator ¶
type CmdEvaluator interface { EvalCommand(commands []string, evalExpr string) CmdEvalResult EvalCommandPolicy(commands []string, evalExpr string, policy string) CmdEvalResult }
CmdEvaluator interface expose one method to evaluate command with evalExpr
func NewEvalCmd ¶ added in v0.0.2
func NewEvalCmd() CmdEvaluator
NewEvalCmd instantiate new command evaluator
type CommandExec ¶
type CommandExec struct { }
CommandExec object
func (CommandExec) Exec ¶
func (ce CommandExec) Exec(command string) (*CommandResult, error)
Exec execute shell command #nosec
type CommandResult ¶
CommandResult return data
type Executor ¶
type Executor interface {
Exec(command string) (*CommandResult, error)
}
Executor defines the interface for shell command executor exec.go
type FinalResult ¶ added in v0.0.6
type FinalResult struct { EvalExpResult int PolicyResult []utils.PolicyResult }
FinalResult eval result object
type IndexValue ¶
type IndexValue struct {
// contains filtered or unexported fields
}
IndexValue hold command index and result
Click to show internal directories.
Click to hide internal directories.