package jsonpatch
import "github.com/evanphx/json-patch"
Index ¶
- func CreateMergePatch(originalJSON, modifiedJSON []byte) ([]byte, error)
- func Equal(a, b []byte) bool
- func MergeMergePatches(patch1Data, patch2Data []byte) ([]byte, error)
- func MergePatch(docData, patchData []byte) ([]byte, error)
- type Patch
Functions ¶
func CreateMergePatch ¶
CreateMergePatch will return a merge patch document capable of converting the original document(s) to the modified document(s). The parameters can be bytes of either two JSON Documents, or two arrays of JSON documents. The merge patch returned follows the specification defined at http://tools.ietf.org/html/draft-ietf-appsawg-json-merge-patch-07
func Equal ¶
Equal indicates if 2 JSON documents have the same structural equality.
func MergeMergePatches ¶
MergeMergePatches merges two merge patches together, such that applying this resulting merged merge patch to a document yields the same as merging each merge patch to the document in succession.
func MergePatch ¶
MergePatch merges the patchData into the docData.
Types ¶
type Patch ¶
type Patch []operation
Patch is an ordered collection of operations.
func DecodePatch ¶
DecodePatch decodes the passed JSON document as an RFC 6902 patch.
func (Patch) Apply ¶
Apply mutates a JSON document according to the patch, and returns the new document.
func (Patch) ApplyIndent ¶
ApplyIndent mutates a JSON document according to the patch, and returns the new document indented.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
cmd | |
cmd/json-patch |
- Version
- v3.0.0+incompatible
- Published
- Mar 22, 2018
- Platform
- js/wasm
- Imports
- 6 packages
- Last checked
- now –
Tools for package owners.