legacy

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeepKeyExtractor deprecated

type DeepKeyExtractor struct {
	Key string
}

DeepKeyExtractor is a Transformer that finds all instances of a given key in the json stream and returns their associated values (in a stream)

Deprecated: Use JSONPath descendant queries instead (e.g., $..key). This transformer is kept for backward compatibility in the CLI.

E.g. if the key is "id"

[{"id": 5, "parent": {"id": 2}}, {"id": 10}] -> 5 2 10

func (*DeepKeyExtractor) TransformValue

func (f *DeepKeyExtractor) TransformValue(value iterator.Value, out token.WriteStream)

TransformValue implements the DeepKeyExtractor transform

type KeyExtractor deprecated

type KeyExtractor struct {
	Key string
}

KeyExtractor is a Transformer that transforms an object into the value associated with a particular key.

Deprecated: Use JSONPath queries instead (e.g., $.key). This transformer is kept for backward compatibility in the CLI.

E.g. if the key is "name"

{"name": "Casimir", "color": "orange"} -> "Casimir"
{"id": 555, "status": "Done"}          -> <empty stream>
[1, 2, 3]                              -> <empty stream>
[{"name": "Kim"}, {"name": "Tim"}]     -> <empty stream>

func (*KeyExtractor) TransformValue

func (f *KeyExtractor) TransformValue(value iterator.Value, out token.WriteStream)

TransformValue implements the KeyExtractor transform

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL