json

package
v1.7.5 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2022 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPatch

func CheckPatch(patch []byte) error

func JoinPatches

func JoinPatches(patches ...[]byte) []byte

JoinPatches joins array of serialized JSON patches to the single JSONPatch array It accepts patch operations and patches (arrays of patch operations) and returns a single combined patch.

func MarshalPatch

func MarshalPatch(path, op string, value interface{}) ([]byte, error)

Types

type Patch

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

func NewPatch

func NewPatch(path, op string, value interface{}) Patch

func UnmarshalPatch

func UnmarshalPatch(patch []byte) (*Patch, error)

func (*Patch) Marshal

func (p *Patch) Marshal() ([]byte, error)

func (*Patch) ToPatchBytes

func (p *Patch) ToPatchBytes() ([]byte, error)

Jump to

Keyboard shortcuts

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