kops/vendor/github.com/evanphx/json-patch
Justin Santa Barbara 27e68d23f6 Include vendored dependencies
glide just has too many edge-cases still, sadly.
2016-07-05 00:03:07 -04:00
..
.travis.yml Include vendored dependencies 2016-07-05 00:03:07 -04:00
LICENSE Include vendored dependencies 2016-07-05 00:03:07 -04:00
README.md Include vendored dependencies 2016-07-05 00:03:07 -04:00
merge.go Include vendored dependencies 2016-07-05 00:03:07 -04:00
merge_test.go Include vendored dependencies 2016-07-05 00:03:07 -04:00
patch.go Include vendored dependencies 2016-07-05 00:03:07 -04:00
patch_test.go Include vendored dependencies 2016-07-05 00:03:07 -04:00

README.md

JSON-Patch

Provides the ability to modify and test a JSON according to a RFC6902 JSON patch and RFC7396 JSON Merge Patch.

Version: 1.0

GoDoc

Build Status

API Usage

  • Given a []byte, obtain a Patch object

    obj, err := jsonpatch.DecodePatch(patch)

  • Apply the patch and get a new document back

    out, err := obj.Apply(doc)

  • Create a JSON Merge Patch document based on two json documents (a to b):

    mergeDoc, err := jsonpatch.CreateMergePatch(a, b)

  • Bonus API: compare documents for structural equality

    jsonpatch.Equal(doca, docb)