json

package
v1.8.1-rc.4 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 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 MarshalPatchOperation added in v1.8.0

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

Types

type PatchOperation added in v1.8.0

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

func NewPatchOperation added in v1.8.0

func NewPatchOperation(path, op string, value interface{}) PatchOperation

func UnmarshalPatchOperation added in v1.8.0

func UnmarshalPatchOperation(patch []byte) (*PatchOperation, error)

func (*PatchOperation) Marshal added in v1.8.0

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

func (*PatchOperation) ToPatchBytes added in v1.8.0

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

Jump to

Keyboard shortcuts

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