patch

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PatchReplaceOp = "replace"
	PatchTestOp    = "test"
	PatchAddOp     = "add"
	PatchRemoveOp  = "remove"
)

Variables

This section is empty.

Functions

func EscapeJSONPointer

func EscapeJSONPointer(ptr string) string

func GeneratePatchPayload

func GeneratePatchPayload(patches ...PatchOperation) ([]byte, error)

func GenerateTestReplacePatch

func GenerateTestReplacePatch(path string, oldValue, newValue interface{}) ([]byte, error)

Types

type PatchOperation

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

func UnmarshalPatch

func UnmarshalPatch(patch []byte) ([]PatchOperation, error)

Jump to

Keyboard shortcuts

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