import "github.com/qntfy/kazaam/transform"
Package transform package contains canonical implementations of Kazaam transforms.
coalesce.go concat.go default.go delete.go extract.go pass.go shift.go timestamp.go util.go uuid.go
var ( NonExistentPath = RequireError("Path does not exist") )
Coalesce checks multiple keys and returns the first matching key found in raw []byte.
Concat combines any specified fields and literal strings into a single string value with raw []byte.
Default sets specific value(s) in output json in raw []byte.
Delete deletes keys in-place from the provided data if they exist keys are specified in an array under "keys" in the spec.
Extract returns the specified path as the top-level object in raw []byte.
func HandleUnquotedStrings(value []byte, dt jsonparser.ValueType) []byte
jsonparser strips quotes from returned strings, this adds them back
Pass performs no manipulation of the passed-in data. It is useful for testing/default behavior.
Shift moves values from one provided json path to another in raw []byte.
Timestamp parses and formats timestamp strings using the golang syntax
UUID tries to generate a UUID based on spec components
type Config struct { Spec *map[string]interface{} `json:"spec"` Require bool `json:"require,omitempty"` InPlace bool `json:"inplace,omitempty"` KeySeparator string `json:"keySeparator"` }
Config contains the options that dictate the behavior of a transform. The internal `spec` object can be an arbitrary json configuration for the transform.
ParseError should be thrown when there is an issue with parsing any of the specification or data
func (p ParseError) Error() string
RequireError should be thrown if a required key is missing in the data
func (r RequireError) Error() string
SpecError should be thrown if the spec for a transform is malformed
Package transform imports 9 packages (graph) and is imported by 7 packages. Updated 2019-08-13. Refresh now. Tools for package owners.