jsonpatch

package
v0.0.31 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTestFailed   = evanJP.ErrTestFailed
	ErrMissing      = evanJP.ErrMissing
	ErrUnknownType  = evanJP.ErrUnknownType
	ErrInvalid      = evanJP.ErrInvalid
	ErrInvalidIndex = evanJP.ErrInvalidIndex

	ErrBadJSONDoc  = errors.New("invalid JSON document")
	ErrMarshalJSON = errors.New("JSON Marshal error")
)
View Source
var NewOperation = jsonPatchConstructor.NewPatch //nolint:gochecknoglobals

Functions

func Q

func Q(s string) string

Escaping some characters, corresponds to https://www.rfc-editor.org/rfc/rfc6901#section-3

Types

type Operation

----------------------------------------------------------------------------

type Patch

type Patch []Operation // todo(SV): should not contains duplicate paths

func CreatePatch added in v0.0.27

func CreatePatch(a, b any) (Patch, error)

func CreatePatchForJson added in v0.0.27

func CreatePatchForJson(a, b []byte) (Patch, error)

func (Patch) Bytes

func (r Patch) Bytes() []byte

func (Patch) Json added in v0.0.29

func (r Patch) Json() string

func (Patch) Len

func (r Patch) Len() int

Len for https://godoc.org/sort#Interface

func (Patch) Less

func (r Patch) Less(i, j int) bool

Less for https://godoc.org/sort#Interface

func (Patch) Sort

func (r Patch) Sort() Patch

func (Patch) String

func (r Patch) String() string

func (Patch) Swap

func (r Patch) Swap(i, j int)

Swap for https://godoc.org/sort#Interface

Jump to

Keyboard shortcuts

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