jx: github.com/jenkins-x/jx/pkg/util/json Index | Files

package json

import "github.com/jenkins-x/jx/pkg/util/json"


Package Files


func CreatePatch Uses

func CreatePatch(before, after interface{}) ([]byte, error)

CreatePatch creates a patch as specified in http://jsonpatch.com/.

'before' is original, 'after' is the modified struct. The function will return the patch as byte array.

An error will be returned if any of the two structs is nil.

type Patch Uses

type Patch []jsonpatch.JsonPatchOperation

Patch is a slice of JsonPatchOperations

func (Patch) MarshalJSON Uses

func (p Patch) MarshalJSON() ([]byte, error)

MarshalJSON converts the Patch into a byte array

Package json imports 3 packages (graph) and is imported by 1 packages. Updated 2019-07-20. Refresh now. Tools for package owners.