Expand description
TypeDefs
The type definitions for typedefs record the various possible type definitions for the state that can be passed through a VRL program.
TypeDef contains a KindInfo.
KindInfo can be:
Unknown - We don’t know what type this is.
Known - A set of the possible known TypeKinds. There can be multiple possible types for a
path in scenarios such as if .thing { .x = "hello" } else { .x = 42 }. In that example after
that statement is run, .x could contain either an string or an integer, we won’t know until
runtime exactly which.
TypeKind is a concrete type for a path, Bytes (string), Integer, Float, Boolean,
Timestamp, Regex, Null or Array or Object.
Array is a Map of Index -> KindInfo.
Index can be a specific index into that array, or Any which represents any index found within
that array.
Object is a Map of Field -> KindInfo.
Field can be a specific field name of the object, or Any which represents any element found
within that object.
Structs§
- TypeDef
- Properties for a given expression that express the expected outcome of the expression.