json

package
v1.3.1119 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 15, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreatePatch

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.

Types

type Patch

Patch is a slice of JsonPatchOperations

func (Patch) MarshalJSON

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

MarshalJSON converts the Patch into a byte array

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL