transforms

package
Version: v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2022 License: None detected not legal advice Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Flatten

func Flatten(p *turbine.Payload) error

Flatten takes a potentially nested JSON payload and returns a flattened representation, using a "." as a delimiter. e.g. {"user": {"id":16, "name": "alice"}} becomes {"user.id":16,"user.name":"alice"} If an array of nested objects is encountered, the index of the element will be appended to the field name. e.g. {"user.location.1":"London, UK", "user.location.2":"San Francisco, USA"}

func FlattenSub

func FlattenSub(p *turbine.Payload, path string) error

FlattenSub takes a potentially nested JSON payload and a path (in dot notation e.g. "foo.bar") and returns a JSON object with only the nested structure at the path specified flattened.

func FlattenSubWithDelimiter

func FlattenSubWithDelimiter(p *turbine.Payload, path string, del string) error

FlattenSubWithDelimiter is a variant of FlattenSub that supports a custom delimiter.

func FlattenWithDelimiter

func FlattenWithDelimiter(p *turbine.Payload, del string) error

FlattenWithDelimiter is a variant of Flatten that supports a custom delimiter.

func Unwrap

func Unwrap(p *turbine.Payload) error

Unwrap takes a JSON payload that may or may not be of the JSON with Schema format and returns only the "payload". In the case where there is no schema envelope, the original unmodified record is returned without error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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