Automatic merge from submit-queue go-client: Use httpcache client for all requests, even though only openapi returns ETags for caching **What this PR does / why we need it**: Use HTTP ETag for caching Swagger spec download This also adds a new command-line flag "cachedir" to specify where the cache should keep its file. It defaults to `$HOME/.kube/http-cache`. **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: partly #38637 **Special notes for your reviewer**: Because this adds a bunch of dependencies, and removes a couple of files, I do recommend reading each commit individually. **Release note**: ```release-note ``` Kubernetes-commit: fc89743dca6b563063b74728c3b28100cf674d9d |
||
|---|---|---|
| .. | ||
| .travis.yml | ||
| LICENSE | ||
| README.md | ||
| merge.go | ||
| patch.go | ||
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
API Usage
-
Given a
[]byte, obtain a Patch objectobj, 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)