Skip to content

Commit f202606

Browse files
authored
Merge pull request #113 from JoshKCarroll/fix-travis
Fix travis
2 parents 3aad90b + 58d780c commit f202606

2 files changed

Lines changed: 47 additions & 8 deletions

File tree

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ script:
1111
deploy:
1212
provider: releases
1313
api_key:
14-
secure: MN+77oqfxr2Wy7xvdS1EWCJeKt5FDjXqwZ3cwcM2TxOxfxpxMKytzSeiB8I60VOqu/hED67/6vLBAuGrgF9BdgEwx6AB6oBh9ws3wSppCjYAQvIhf79uktBjfj+8ArI7Yj2H7SqBWgyhif98uwui9vUUEVAe2qqukYXWHEM2jevTQkb6Kto8z1enNo9qooMDbaTN5+gXCttCnr7PiP4aKT0i65sJOFB5HZmvk69qo/UI1xHUMbBYG+AazjS9TNDptTBQD6Nu2/4R8yPE2r4830lhxLHEGW6pQ/amMPQoTEbuoQMrqdoeik9MN1vE6i5iW7aU9QvYCzWpvMyVyx4uYYUnfalhJe0+9Bl6MOA6AsFf1twKLYe+XVKVMfgBI0iDMuf28nW1S77hiSNDhi2yzWpzV+qLcr5QT3L+dtDVBfbK+o0n4xIScQ4G5Tp0Nu6yfoKJx/0fCAVW3iFyWyXQpvXh2oiF6yBL27Z2F3lCqEftmjsm9J5j9biqoYulyfOJ/1eeUsoKHjRv7ZKDbaft5BdwLgKxf9h3L4GhOj8Wj+1mrkqdXRlVRSBszpKx3xrt1z35RVXWpSNnh8nF5n6D26RrRPrkOkPm6FsOaJwqwO2KQVa38l7IY5dGs5sGSqxi9agKPuBztBWntwqZ62H5cx6gKZsou0zYipxK4Cm3H98=
14+
secure: "ISBkRDquOVqmhZ75hk5RAcPtL6FFGZGB3sIzxR8HZuG82GMvDcq2rt90LsxNN986MTsVXT9+RwwODGGVmZad8Fvupg+EFPMGHcaiMjKxGCDyUwzHpsDYMPGEzczlhKmgDbEM02cOinFDFhHVs10e2rGz4nLQVo3TGxmjkEK1tvlX/+yevtsisEAodwrByRXVD+/kFgx7hle7HtVQW+mMmzMMYs8Z53R8+7v1qTzRZJ2MvmOfuQ4Q3KPvHVKW9WPoAmFGccSD30QHk4XAH1g87vQK1rg8oJS+dqVkgfB3dptMpiVqoBEqJIahITi85QHNiksyTka4/RAtVYULEfYMr+nsVX68P7pW/K8K0qeC8Q6Nlhw45E1If7zPcLy42E55XZTRCCcjHdKhbKBSgyeD0eE3GjbBe0U62skidCWmu2v3aJG3Ts48eRLhmJ6LonfeFdr8cV/f5n5xj/X0uSW+R8FnktHBjswv4nvEasx589/QX0bmSJafARIRZ1Uh7u/tgJuD3ZXQ43EMnuDf7Juw+MkuKmHg331mTkS4Y2HzFQt9K3t7HrGOvPHvKXNbSx6EAn3OWrBlI7OgSZEVrOGNqszSlWz/D2q/4t/2HClnc+5dha2EIdePledjqBk1FYmRwxOkMiV1HyiPwWF8bCdY07ZWK+/mgOK8uH3wdCHahN4="
1515
file:
1616
- bin/kazaam_darwin_amd64
1717
- bin/kazaam_linux_amd64

README.md

Lines changed: 46 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)
66
[![GitHub release](https://img.shields.io/github/release/qntfy/kazaam.svg?maxAge=3600)](https://github.com/qntfy/kazaam/releases/latest)
77
[![Go Report Card](https://goreportcard.com/badge/github.com/qntfy/kazaam)](https://goreportcard.com/report/github.com/qntfy/kazaam)
8-
[![GoDoc](https://godoc.org/github.com/qntfy/kazaam?status.svg)](http://godoc.org/gopkg.in/qntfy/kazaam.v3)
8+
[![GoDoc](https://godoc.org/github.com/qntfy/kazaam?status.svg)](https://pkg.go.dev/github.com/qntfy/kazaam/v4)
99

1010
## Description
11+
1112
Kazaam was created with the goal of supporting easy and fast transformations of JSON data with Golang.
1213
This functionality provides us with an easy mechanism for taking intermediate JSON message representations
1314
and transforming them to formats required by arbitrary third-party APIs.
@@ -17,9 +18,11 @@ transform "specification" also defined in JSON. A specification is comprised of
1718
Specification Support, below, for more details.
1819

1920
## Documentation
20-
API Documentation is available at http://godoc.org/gopkg.in/qntfy/kazaam.v3.
21+
22+
API Documentation is available on [pkg.go.dev](https://pkg.go.dev/github.com/qntfy/kazaam/v4).
2123

2224
## Features
25+
2326
Kazaam is primarily designed to be used as a library for transforming arbitrary JSON.
2427
It ships with six built-in transform types, described below, which provide significant flexibility
2528
in reshaping JSON data.
@@ -37,7 +40,9 @@ Due to performance considerations, Kazaam does not fully validate that input dat
3740
down use of Kazaam.
3841

3942
## Specification Support
43+
4044
Kazaam currently supports the following transforms:
45+
4146
- shift
4247
- concat
4348
- coalesce
@@ -49,8 +54,10 @@ Kazaam currently supports the following transforms:
4954
- delete
5055

5156
### Shift
57+
5258
The shift transform is the current Kazaam workhorse used for remapping of fields.
5359
The specification supports jsonpath-esque JSON accesses and sets. Concretely
60+
5461
```javascript
5562
{
5663
"operation": "shift",
@@ -63,6 +70,7 @@ The specification supports jsonpath-esque JSON accesses and sets. Concretely
6370
```
6471

6572
executed on a JSON message with format
73+
6674
```javascript
6775
{
6876
"doc": {
@@ -75,6 +83,7 @@ executed on a JSON message with format
7583
```
7684

7785
would result in
86+
7887
```javascript
7988
{
8089
"object": {
@@ -86,6 +95,7 @@ would result in
8695
```
8796

8897
The jsonpath implementation supports a few special cases:
98+
8999
- *Array accesses*: Retrieve `n`th element from array
90100
- *Array wildcarding*: indexing an array with `[*]` will return every matching element in an array
91101
- *Top-level object capture*: Mapping `$` into a field will nest the entire original object under the requested key
@@ -99,7 +109,9 @@ Finally, shift by default is destructive. For in-place operation, an optional `"
99109
field may be set.
100110

101111
### Concat
112+
102113
The concat transform allows the combination of fields and literal strings into a single string value.
114+
103115
```javascript
104116
{
105117
"operation": "concat",
@@ -116,6 +128,7 @@ The concat transform allows the combination of fields and literal strings into a
116128
```
117129

118130
executed on a JSON message with format
131+
119132
```javascript
120133
{
121134
"a": {
@@ -125,6 +138,7 @@ executed on a JSON message with format
125138
```
126139

127140
would result in
141+
128142
```javascript
129143
{
130144
"a": {
@@ -134,6 +148,7 @@ would result in
134148
```
135149

136150
Notes:
151+
137152
- *sources*: list of items to combine (in the order listed)
138153
- literal values are specified via `value`
139154
- field values are specified via `path` (supports the same addressing as `shift`)
@@ -146,7 +161,9 @@ Kazaam will throw an error if *any* of the paths in the source JSON are not
146161
present.
147162

148163
### Coalesce
164+
149165
A coalesce transform provides the ability to check multiple possible keys to find a desired value. The first matching key found of those provided is returned.
166+
150167
```javascript
151168
{
152169
"operation": "coalesce",
@@ -157,6 +174,7 @@ A coalesce transform provides the ability to check multiple possible keys to fin
157174
```
158175

159176
executed on a json message with format
177+
160178
```javascript
161179
{
162180
"doc": {
@@ -168,6 +186,7 @@ executed on a json message with format
168186
```
169187

170188
would result in
189+
171190
```javascript
172191
{
173192
"doc": {
@@ -181,6 +200,7 @@ would result in
181200

182201
Coalesce also supports an `ignore` array in the spec. If an otherwise matching key has a value in `ignore`, it is not considered a match.
183202
This is useful e.g. for empty strings
203+
184204
```javascript
185205
{
186206
"operation": "coalesce",
@@ -192,7 +212,9 @@ This is useful e.g. for empty strings
192212
```
193213

194214
### Extract
215+
195216
An `extract` transform provides the ability to select a sub-object and have kazaam return that sub-object as the top-level object. For example
217+
196218
```javascript
197219
{
198220
"operation": "extract",
@@ -203,6 +225,7 @@ An `extract` transform provides the ability to select a sub-object and have kaza
203225
```
204226

205227
executed on a json message with format
228+
206229
```javascript
207230
{
208231
"doc": {
@@ -214,6 +237,7 @@ executed on a json message with format
214237
```
215238

216239
would result in
240+
217241
```javascript
218242
{
219243
"name": "the.subobject",
@@ -222,13 +246,15 @@ would result in
222246
```
223247

224248
### Timestamp
249+
225250
A `timestamp` transform parses and formats time strings using the golang
226251
syntax. **Note**: this operation is done in-place. If you want to preserve the
227-
original string(s), pair the transform with `shift`. This transform also
228-
supports the `$now` operator for `inputFormat`, which will set the current
252+
original string(s), pair the transform with `shift`. This transform also
253+
supports the `$now` operator for `inputFormat`, which will set the current
229254
timestamp at the specified path, formatted according to the `outputFormat`.
230255
`$unix` is supported for both input and output formats as a Unix time, the
231256
number of seconds elapsed since January 1, 1970 UTC as an integer string.
257+
232258
```javascript
233259
{
234260
"operation": "timestamp",
@@ -249,6 +275,7 @@ number of seconds elapsed since January 1, 1970 UTC as an integer string.
249275
```
250276

251277
executed on a json message with format
278+
252279
```javascript
253280
{
254281
"timestamp": [
@@ -260,6 +287,7 @@ executed on a json message with format
260287
```
261288

262289
would result in
290+
263291
```javascript
264292
{
265293
"timestamp": [
@@ -272,6 +300,7 @@ would result in
272300
```
273301

274302
### UUID
303+
275304
A `uuid` transform generates a UUID based on the spec. Currently supports UUIDv3, UUIDv4, UUIDv5.
276305

277306
For version 4 is a very simple spec
@@ -288,6 +317,7 @@ For version 4 is a very simple spec
288317
```
289318

290319
executed on a json message with format
320+
291321
```javascript
292322
{
293323
"doc": {
@@ -301,6 +331,7 @@ executed on a json message with format
301331
```
302332

303333
would result in
334+
304335
```javascript
305336
{
306337
"doc": {
@@ -334,6 +365,7 @@ For UUIDv3 & UUIDV5 are a bit more complex. These require a Name Space which is
334365
```
335366

336367
executed on a json message with format
368+
337369
```javascript
338370
{
339371
"doc": {
@@ -348,6 +380,7 @@ executed on a json message with format
348380
```
349381

350382
would result in
383+
351384
```javascript
352385
{
353386
"doc": {
@@ -362,9 +395,10 @@ would result in
362395
}
363396
```
364397

365-
366398
### Default
399+
367400
A default transform provides the ability to set a key's value explicitly. For example
401+
368402
```javascript
369403
{
370404
"operation": "default",
@@ -373,11 +407,13 @@ A default transform provides the ability to set a key's value explicitly. For ex
373407
}
374408
}
375409
```
376-
would ensure that the output JSON message includes `{"type": "message"}`.
377410

411+
would ensure that the output JSON message includes `{"type": "message"}`.
378412

379413
### Delete
414+
380415
A delete transform provides the ability to delete keys in place.
416+
381417
```javascript
382418
{
383419
"operation": "delete",
@@ -388,6 +424,7 @@ A delete transform provides the ability to delete keys in place.
388424
```
389425

390426
executed on a json message with format
427+
391428
```javascript
392429
{
393430
"doc": {
@@ -399,6 +436,7 @@ executed on a json message with format
399436
```
400437

401438
would result in
439+
402440
```javascript
403441
{
404442
"doc": {
@@ -408,14 +446,15 @@ would result in
408446
}
409447
```
410448

411-
412449
### Pass
450+
413451
A pass transform, as the name implies, passes the input data unchanged to the output. This is used internally
414452
when a null transform spec is specified, but may also be useful for testing.
415453

416454
## Usage
417455

418456
To start, go get the versioned repository:
457+
419458
```sh
420459
go get gopkg.in/qntfy/kazaam.v3
421460
```

0 commit comments

Comments
 (0)