# Functions
ClosureFunction allows you to define a Function using closures, this is a convenient constructor for function implementations that don't manage complex state.
ErrFrom wraps an error with the annotation of a function.
ExecToBytes returns a byte slice from a function execution.
ExecToString returns a string from a function execution.
FunctionDocs returns a slice of specs, one for each function.
IClone performs a deep copy of a generic value.
ICompare returns true if both the left and right are equal according to one of the following conditions:
- The types exactly match and have the same value - The types are both either a string or byte slice and the underlying data is the same - The types are both numerical and have the same value - Both types are a matching slice or map containing values matching these same conditions.
IGetBool takes a boxed value and attempts to extract a boolean from it.
IGetBytes takes a boxed value and attempts to return a byte slice value.
IGetFloat32 takes a boxed value and attempts to extract a number (float32) from it.
IGetInt takes a boxed value and attempts to extract an integer (int64) from it.
IGetNumber takes a boxed value and attempts to extract a number (float64) from it.
IGetString takes a boxed value and attempts to return a string value.
IGetTimestamp takes a boxed value and attempts to coerce it into a timestamp, either by interpretting a numerical value as a unix timestamp, or by parsing a string value as RFC3339Nano.
IIsNull returns whether a bloblang type is null, this includes Delete and Nothing types.
InitFunctionHelper attempts to initialise a function by its name and a list of arguments, this is convenient for writing tests.
InitMethodHelper attempts to initialise a method by its name, target function and arguments, this is convenient for writing tests.
ISanitize takes a boxed value of any type and attempts to convert it into one of the following types: string, []byte, int64, uint64, float64, bool, []interface{}, map[string]interface{}, Delete, Nothing.
IToBool takes a boxed value and attempts to extract a boolean from it or parse it into a bool.
IToBytes takes a boxed value of any type and attempts to convert it into a byte slice.
IToFloat32 takes a boxed value and attempts to extract a number (float32) from it or parse one.
IToFloat64 takes a boxed value and attempts to extract a number (float64) from it or parse one.
IToInt takes a boxed value and attempts to extract a number (int64) from it or parse one.
IToInt16 takes a boxed value and attempts to extract a number (int64) from it or parse one.
IToInt32 takes a boxed value and attempts to extract a number (int32) from it or parse one.
IToInt8 takes a boxed value and attempts to extract a number (int8) from it or parse one.
IToNumber takes a boxed value and attempts to extract a number (float64) from it or parse one.
IToString takes a boxed value of any type and attempts to convert it into a string.
IToUint takes a boxed value and attempts to extract a number (uint64) from it or parse one.
IToUint16 takes a boxed value and attempts to extract a number (uint16) from it or parse one.
IToUint32 takes a boxed value and attempts to extract a number (uint32) from it or parse one.
IToUint8 takes a boxed value and attempts to extract a number (uint8) from it or parse one.
ITypeOf returns the type of a boxed value as a discrete ValueType.
MethodDocs returns a slice of specs, one for each method.
NewArithmeticExpression creates a single query function from a list of child functions and the arithmetic operator types that chain them together.
NewArrayLiteral creates an array literal from a slice of values.
NewDeprecatedFunctionSpec creates a new function spec that is deprecated.
NewDeprecatedMethodSpec creates a new method spec that is deprecated.
NewExampleSpec creates a new example spec.
NewFieldFunction creates a query function that returns a field from the current context.
NewFunctionSet creates a function set without any functions in it.
NewFunctionSpec creates a new function spec.
NewGetMethod creates a new get method.
NewHiddenFunctionSpec creates a new function spec that is hidden from the docs.
NewHiddenMethodSpec creates a new method spec that is hidden from docs.
NewIfFunction creates a logical if expression from a query which should return a boolean value.
NewLiteralFunction creates a query function that returns a static, literal value.
NewMapLiteral creates a map literal from a slice of key/value pairs.
NewMapMethod attempts to create a map method.
NewMatchCase creates a single match case of a match expression, where a case query is checked and, if true, the underlying query is executed and returned.
NewMatchFunction takes a contextual mapping and a list of MatchCases, when the function is executed.
NewMetaFunction creates a new function for obtaining a metadata value.
NewMethodSet creates a method set without any methods in it.
NewMethodSpec creates a new method spec.
NewNamedContextFieldFunction creates a query function that attempts to return a field from a named context.
NewNamedContextFunction wraps a function and ensures that when the function is executed with a new context the context is captured under a new name, with the "main" context left intact.
NewNotTestedExampleSpec creates a new not tested example spec.
NewParams creates a new empty parameters definition.
NewRootFieldFunction creates a query function that returns a field from the root context.
NewTargetPath constructs a new target path from a type and zero or more path segments.
NewTypeError creates a new type error.
NewTypeErrorFrom creates a new type error with an annotation of the query that provided the wrong type.
NewTypeMismatch creates a new type mismatch error.
NewVarFunction creates a new variable function.
Not returns a logical NOT of a child function.
ParamAny creates a new parameter that can be any type (excluding query).
ParamArray creates a new array typed parameter.
ParamBool creates a new bool typed parameter.
ParamFloat creates a new float typed parameter.
ParamInt64 creates a new integer typed parameter.
ParamObject creates a new object typed parameter.
ParamQuery creates a new query typed parameter.
ParamString creates a new string typed parameter.
ParamTimestamp creates a new timestamp typed parameter.
SliceToDotPath returns a valid dot path from a slice of path segments.
VariadicParams creates a new empty parameters definition where any number of nameless arguments are considered valid.
# Constants
All arithmetic operators.
All arithmetic operators.
All arithmetic operators.
All arithmetic operators.
All arithmetic operators.
All arithmetic operators.
All arithmetic operators.
All arithmetic operators.
All arithmetic operators.
All arithmetic operators.
All arithmetic operators.
All arithmetic operators.
All arithmetic operators.
All arithmetic operators.
No description provided by the author
No description provided by the author
TargetTypes.
TargetTypes.
TargetTypes.
TargetTypes.
# Variables
AllFunctions is a set containing every single function declared by this package, and any globally declared plugin methods.
AllMethods is a set containing every single method declared by this package, and any globally declared plugin methods.
ErrDivideByZero occurs when an arithmetic operator is prevented from dividing a value by zero.
Function categories.
Function categories.
Function categories.
Function categories.
Function categories.
Function categories.
Method categories.
Method categories.
Method categories.
Method categories.
Method categories.
Method categories.
Method categories.
Method categories.
Method categories.
Method categories.
Method categories.
Method categories.
Component statuses.
Component statuses.
Component statuses.
Component statuses.
Component statuses.
ValueType variants.
ValueType variants.
ValueType variants.
ValueType variants.
ValueType variants.
Specialised and not generally known over ValueNumber.
ValueType variants.
ValueType variants.
ValueType variants.
ValueType variants.
ValueType variants.
ValueType variants.
ValueType variants.
ValueType variants.
# Structs
ElseIf represents an else-if block in an if expression.
ErrNoContext is a common query error where a query attempts to reference a structured field when there is no context.
ExampleSpec provides a mapping example and some input/output results to display.
FunctionContext provides access to a range of query targets for functions to reference.
FunctionSet contains an explicit set of functions to be available in a Bloblang query.
FunctionSpec describes a Bloblang function.
Literal wraps a static value and returns it for each invocation of the function.
MatchCase represents a single match case of a match expression, where a case query is checked and, if true, the underlying query is executed and returned.
MethodCatSpec describes how a method behaves in the context of a given category.
MethodSet contains an explicit set of methods to be available in a Bloblang query.
MethodSpec describes a Bloblang method.
NamedContextFunction wraps a query function in a mechanism that captures the current context under an alias.
ParamDefinition describes a single parameter for a function or method.
Params defines the expected arguments of a function or method.
ParsedParams is a reference to the arguments of a method or function instantiation.
TargetPath represents a target type and segmented path that a query function references.
TargetsContext describes the current Bloblang execution environment from the perspective of a particular query function in a way that allows it to determine which values it is targeting and the origins of those values.
TypeError represents an error where a value of a type was required for a function, method or operator but instead a different type was found.
TypeMismatch represents an error where two values should be a comparable type but are not.
# Interfaces
Function takes a set of contextual arguments and returns the result of the query.
Iterable is an interface implemented by Bloblang functions that are able to expose their results as an interator, allowing for more efficient chaining of array based methods.
Iterator allows traversal of a Bloblang function result in iterations.
MessageBatch is an interface type to be given to a query function, it allows the function to resolve fields and metadata from a Benthos message batch.
MetaMsg provides access to the metadata of a message.
# Type aliases
ArithmeticOperator represents an arithmetic operation that combines the results of two query functions.
FunctionCtor constructs a new function from input arguments.
MethodCtor constructs a new method from a target function and input args.
Status of a function or method.
TargetType represents a query target type, which is a source of information that a query might require, such as metadata, structured message contents, the context, etc.
ValueType represents a discrete value type supported by Bloblang queries.