package
3.65.0
Repository: https://github.com/jeffail/benthos.git
Documentation: pkg.go.dev

# Functions

Array parses an array literal.
BestMatch accepts one or more parsers and tries them all against an input.
Boolean parses either 'true' or 'false' into a boolean value.
Char parses a single character and expects it to match one candidate.
Comment parses a # comment (always followed by a line break).
Delimited attempts to parse one or more primary parsers, where after the first parse a delimiter is expected.
DelimitedPattern attempts to parse zero or more primary parsers in between a start and stop parser, where after the first parse a delimiter is expected.
Discard the result of a child parser, regardless of the result.
DiscardAll the results of a child parser, applied until it fails.
EmptyContext returns a parser context with no functions, methods or import capabilities.
EmptyLine ensures that a line is empty, but doesn't advance the parser beyond the newline char.
EndOfInput ensures that the input is now empty.
Expect applies a parser and if an error is returned the list of expected candidates is replaced with the given strings.
Fail creates a result with an error from failed parsing.
GlobalContext returns a parser context with globally defined functions and methods.
InRange parses any number of characters between two runes inclusive.
InSet parses any number of characters within a set of runes.
JoinStringPayloads wraps a parser that returns a []interface{} of exclusively string values and returns a result of a joined string of all the elements.
LineAndColOf returns the line and column position of a tailing clip from an input.
LiteralValue parses a literal bool, number, quoted string, null value, array of literal values, or object.
MustBe applies a parser and if the result is a non-fatal error then it is upgraded to a fatal one.
NewError creates a parser error from the input and a list of expected tokens.
NewFatalError creates a parser error from the input and a wrapped fatal error indicating that this parse succeeded partially, but a requirement was not met that means the parsed input is invalid and that all parsing should stop.
NewImportError wraps a parser error with a filepath for when a parser has attempted to parse content of an imported file.
Newline parses a line break.
NewlineAllowComment parses an optional comment followed by a mandatory line break.
NotChar parses any number of characters until they match a single candidate.
Nothing is a parser that always returns an error.
NotInSet parses any number of characters until a rune within a given set is encountered.
Null parses a null literal value.
Number parses any number of numerical characters into either an int64 or, if the number contains float characters, a float64.
Object parses an object literal.
OneOf accepts one or more parsers and tries them in order against an input.
Optional applies a child parser and if it returns an ExpectedError then it is cleared and a nil result is returned instead.
ParseDeprecatedQuery parses an input into a query.Function, but permits deprecated function interpolations.
ParseDotEnvFile attempts to parse a .env file containing environment variable assignments, and returns either a map of key/value assignments or an error.
ParseField attempts to parse a field expression.
ParseMapping parses a bloblang mapping and returns an executor to run it, or an error if the parsing fails.
QuotedString parses a single instance of a quoted string.
Sequence applies a sequence of parsers and returns either a slice of the results or an error if any parser fails.
SnakeCase parses any number of characters of a camel case string.
SpacesAndTabs parses any number of space or tab characters.
Success creates a result with a payload from successful parsing.
Term parses a single instance of a string.
TripleQuoteString parses a single instance of a triple-quoted multiple line string.
UntilFail applies a parser until it fails, and returns a slice containing all results.

# Structs

Context contains context used throughout a Bloblang parser for accessing function and method constructors.
DelimitedResult is an explicit result struct returned by the Delimited parser, containing a slice of primary parser payloads and a slice of delimited parser payloads.
Error represents an error that has occurred whilst attempting to apply a parser function to a given input.
ImportError wraps a parser error with an import file path.
Result represents the result of a parser given an input.

# Interfaces

Importer represents a repository of bloblang files that can be imported by mappings.

# Type aliases

Func is the common signature of a parser function.