Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AttributesFromJSONPath ¶
AttributesFromJSONPath extracts a list of all valid attribute names from a JSON path expression based on the spec outlined in the article https://goessner.net/articles/JsonPath/, which github.com/PaesslerAG/jsonpath implements.
This function ignores all Union operators, Slice operators, Subscript operators, Wildcards, Filter expressions, and Script expressions. For example, for a provided expression of `$.book[?(@.price<10)].authors[1]`, this function would return `[]string{"book", "authors"}`. Recursive descents will also be ignored and instead treated as a direct descent.
All provided expressions must start with a `$.` prefix.
func ValueFromList ¶
ValueFromList attempts to extract a value from the provided list based on the provided includedPrefix and excludedSuffix.
For example, if you want to extract a URL from a header with the following format: `<https://test-instance.oktapreview.com/api/v1/users?after=100u65xtp32NovHoPx1d7&limit=2>; rel="next"`
You could specify a `includedPrefix` of `https://` and an `excludedSuffix` of `>; rel="next"`. This would return the first value found matching this pattern in the following format: `https://test-instance.oktapreview.com/api/v1/users?after=100u65xtp32NovHoPx1d7&limit=2`.
All whitespace is ignored in values, prefixes, and suffixes. If there are multiple matching values provided, the value from the first matched will be returned.
Types ¶
This section is empty.