type ByPath []Operation
func (a ByPath) Len() int
func (a ByPath) Less(i, j int) bool
func (a ByPath) Swap(i, j int)
type JsonPatchOperation = Operation
type Operation struct { Operation string `json:"op"` Path string `json:"path"` Value interface{} `json:"value,omitempty"` }
func CreatePatch(a, b []byte) ([]Operation, error)
CreatePatch creates a patch as specified in http://jsonpatch.com/
'a' is original, 'b' is the modified document. Both are to be given as json encoded content. The function will return an array of JsonPatchOperations
An error will be returned if any of the two documents are invalid.
func NewOperation(op, path string, value interface{}) Operation
func (j *Operation) Json() string
func (j *Operation) MarshalJSON() ([]byte, error)