Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ByPath ¶
type ByPath []*JSONPatchOperation
type JSONPatchOperation ¶
type JSONPatchOperation struct { Operation string `json:"op"` Path string `json:"path"` Value interface{} `json:"value,omitempty"` }
func Diff ¶
func Diff(a, b []byte) ([]*JSONPatchOperation, error)
Diff 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
func NewPatch ¶
func NewPatch(operation, path string, value interface{}) *JSONPatchOperation
func (*JSONPatchOperation) JSON ¶
func (j *JSONPatchOperation) JSON() string
func (*JSONPatchOperation) MarshalJSON ¶
func (j *JSONPatchOperation) MarshalJSON() ([]byte, error)
Click to show internal directories.
Click to hide internal directories.