prometheus-adapter/vendor/github.com/evanphx/json-patch
Solly Ross a293b2bf94 Check in the vendor directory
Travis seems to be having issues pulling deps, so we'll have to check in
the vendor directory and prevent the makefile from trying to regenerate
it normally.
2018-07-13 17:32:49 -04:00
..
.travis.yml Check in the vendor directory 2018-07-13 17:32:49 -04:00
LICENSE Check in the vendor directory 2018-07-13 17:32:49 -04:00
merge.go Check in the vendor directory 2018-07-13 17:32:49 -04:00
patch.go Check in the vendor directory 2018-07-13 17:32:49 -04:00
README.md Check in the vendor directory 2018-07-13 17:32:49 -04:00

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)