patch

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2025 License: Apache-2.0 Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFinalizerPatch

func AddFinalizerPatch(obj metav1.Object, finalizers ...string) client.Patch

func FixPathToValid

func FixPathToValid(path string) string

func RemoveFinalizerPatch

func RemoveFinalizerPatch(obj metav1.Object, finalizers ...string) client.Patch

Types

type JSONPatch

type JSONPatch []JSONPatchItem

func Join

func Join(patches ...JSONPatch) *JSONPatch

func NewJSONPatch

func NewJSONPatch(items ...JSONPatchItem) *JSONPatch

func (*JSONPatch) Append

func (jp *JSONPatch) Append(op JSONPatchOperation, path string, val interface{}) *JSONPatch

func (*JSONPatch) Join

func (jp *JSONPatch) Join(patch JSONPatch)

func (*JSONPatch) JsonPatch

func (jp *JSONPatch) JsonPatch() (client.Patch, error)

func (JSONPatch) Len

func (jp JSONPatch) Len() int32

func (*JSONPatch) Marshal

func (jp *JSONPatch) Marshal() ([]byte, error)

func (*JSONPatch) ToClientPatch

func (jp *JSONPatch) ToClientPatch() (client.Patch, error)

type JSONPatchItem

type JSONPatchItem struct {
	Operation JSONPatchOperation `json:"op"`
	Path      string             `json:"path"`
	Value     interface{}        `json:"value"`
}

type JSONPatchOperation

type JSONPatchOperation string
const (
	// If the target location specifies an object member that does exist, that member's value is replaced.
	Add JSONPatchOperation = "add"

	// The target location MUST exist for the operation to be successful.
	Replace JSONPatchOperation = "replace"

	// The target location MUST exist for the operation to be successful.
	Remove JSONPatchOperation = "remove"

	Move JSONPatchOperation = "move"
	Copy JSONPatchOperation = "copy"

	PathSeparator = "/"
)

Jump to

Keyboard shortcuts

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