jsonpatch: gomodules.xyz/jsonpatch/v3 Index | Files

package jsonpatch

import "gomodules.xyz/jsonpatch/v3"


Package Files


type ByPath Uses

type ByPath []Operation

func (ByPath) Len Uses

func (a ByPath) Len() int

func (ByPath) Less Uses

func (a ByPath) Less(i, j int) bool

func (ByPath) Swap Uses

func (a ByPath) Swap(i, j int)

type JsonPatchOperation Uses

type JsonPatchOperation = Operation

type Operation Uses

type Operation struct {
    Operation string      `json:"op"`
    Path      string      `json:"path"`
    Value     interface{} `json:"value,omitempty"`

func CreatePatch Uses

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 Uses

func NewOperation(op, path string, value interface{}) Operation

func (*Operation) Json Uses

func (j *Operation) Json() string

func (*Operation) MarshalJSON Uses

func (j *Operation) MarshalJSON() ([]byte, error)

Package jsonpatch imports 6 packages (graph) and is imported by 5 packages. Updated 2020-09-16. Refresh now. Tools for package owners.