Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNestedExpression = errors.New("nested expressions are not allowed")
Functions ¶
func ParseConditionExpressions ¶
This function parses resource condition expressions. These expressions need to be standalone expressions so, this function also does some validation. At the end we return the expressions with '${}' removed
To be honest I wouldn't necessarily call it parse, since we are mostly just validating, without caring what's in the expression. Maybe we can rename it in the future 🤔
func ParseResource ¶
func ParseResource(resource map[string]interface{}, resourceSchema *spec.Schema) ([]variable.FieldDescriptor, error)
ParseResource extracts CEL expressions from a resource based on the schema. The resource is expected to be a map[string]interface{}.
Note that this function will also validate the resource against the schema and return an error if the resource does not match the schema. When CEL expressions are found, they are extracted and returned with the expected type of the field (inferred from the schema).
func ParseSchemalessResource ¶
func ParseSchemalessResource(resource map[string]interface{}) ([]variable.FieldDescriptor, error)
ParseSchemalessResource extracts CEL expressions without a schema, this is useful when the schema is not available. e.g RGI statuses
Types ¶
This section is empty.