Documentation
¶
Overview ¶
Package eval provides commands for evaluating and validating CEL expressions and Go templates.
Index ¶
- func CommandCEL(cliParams *settings.Run, ioStreams *terminal.IOStreams, path string) *cobra.Command
- func CommandEval(cliParams *settings.Run, ioStreams *terminal.IOStreams, path string) *cobra.Command
- func CommandTemplate(cliParams *settings.Run, ioStreams *terminal.IOStreams, path string) *cobra.Command
- func CommandValidate(cliParams *settings.Run, ioStreams *terminal.IOStreams, path string) *cobra.Command
- type CELOptions
- type CELResult
- type TemplateOptions
- type TemplateResult
- type ValidateOptions
- type ValidateResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommandCEL ¶
CommandCEL creates the 'eval cel' command.
func CommandEval ¶
func CommandEval(cliParams *settings.Run, ioStreams *terminal.IOStreams, path string) *cobra.Command
CommandEval creates the 'eval' command group.
Types ¶
type CELOptions ¶
type CELOptions struct {
IOStreams *terminal.IOStreams
CliParams *settings.Run
Output string
Expression string
Vars []string
Data string
File string
}
CELOptions holds options for the eval cel command.
type CELResult ¶
type CELResult struct {
Expression string `json:"expression" yaml:"expression" doc:"The CEL expression that was evaluated"`
Result any `json:"result" yaml:"result" doc:"The evaluation result"`
Type string `json:"type" yaml:"type" doc:"The Go type of the result"`
}
CELResult holds the result of evaluating a CEL expression.
type TemplateOptions ¶
type TemplateOptions struct {
IOStreams *terminal.IOStreams
CliParams *settings.Run
Output string
Template string
TemplateFile string
Vars []string
Data string
File string
ShowRefs bool
}
TemplateOptions holds options for the eval template command.
type TemplateResult ¶
type TemplateResult struct {
Output string `json:"output" yaml:"output" doc:"The rendered template output"`
Template string `json:"template" yaml:"template" doc:"The template that was evaluated"`
References []gotmpl.TemplateReference `json:"references,omitempty" yaml:"references,omitempty" doc:"Referenced template variables"`
}
TemplateResult holds the result of evaluating a Go template.
type ValidateOptions ¶
type ValidateOptions struct {
IOStreams *terminal.IOStreams
CliParams *settings.Run
Output string
Expression string
Type string
}
ValidateOptions holds options for the eval validate command.
type ValidateResult ¶
type ValidateResult struct {
Expression string `json:"expression" yaml:"expression" doc:"The expression that was validated" maxLength:"4096"`
Type string `json:"type" yaml:"type" doc:"The expression type (cel or go-template)" maxLength:"20"`
Valid bool `json:"valid" yaml:"valid" doc:"Whether the expression is syntactically valid"`
Error string `json:"error,omitempty" yaml:"error,omitempty" doc:"Error message if invalid" maxLength:"4096"`
References []string `json:"references,omitempty" yaml:"references,omitempty" doc:"Referenced variables found in the expression" maxItems:"100"`
}
ValidateResult holds the result of validating an expression.
Click to show internal directories.
Click to hide internal directories.