minikube/vendor/github.com/evanphx/json-patch
Dan Gillespie fe340e52e7 added localkube and dependencies 2016-05-04 01:54:00 -07:00
..
.travis.yml added localkube and dependencies 2016-05-04 01:54:00 -07:00
LICENSE added localkube and dependencies 2016-05-04 01:54:00 -07:00
README.md added localkube and dependencies 2016-05-04 01:54:00 -07:00
merge.go added localkube and dependencies 2016-05-04 01:54:00 -07:00
patch.go added localkube and dependencies 2016-05-04 01:54:00 -07:00

README.md

JSON-Patch

Provides the abiilty to modify and test a JSON according to a RFC6902 JSON patch and RFC7386 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)