jsonpatch

package
v1.23.0-cx Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

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

Item is a operation of jsonpatch.

type Items

type Items []Item

Items maps the json expression of jsonpatch.

func New

func New() Items

New returns a new Items.

func (Items) Add

func (items Items) Add(op Operation, path string, value any) Items

Add adds a operation of jsonpatch .

func (Items) ToJSON

func (items Items) ToJSON() ([]byte, error)

ToJSON returns the json buffers.

type Operation

type Operation string
const (
	OpAdd     Operation = "add"
	OpRemove  Operation = "remove"
	OpReplace Operation = "replace"
)

Jump to

Keyboard shortcuts

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