yamlpatch

package module
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2025 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package yamlpatch is a library for applying RFC6902 JSON patches to yaml documents. It leverages go-yaml v3's Node type to preserve comments, ordering, and most formatting.

Index

Constants

View Source
const (
	OperationAdd     = yamlpatch.OperationAdd
	OperationReplace = yamlpatch.OperationReplace
	OperationRemove  = yamlpatch.OperationRemove
	OperationMove    = yamlpatch.OperationMove
	OperationCopy    = yamlpatch.OperationCopy
	OperationTest    = yamlpatch.OperationTest
)

Variables

This section is empty.

Functions

func Apply

func Apply(originalBytes []byte, patch Patch) ([]byte, error)

Apply calls ApplyUsingYAMLLibrary using the "gopkg.in/yaml.v3" YAML library.

Types

type Operation

type Operation = yamlpatch.Operation

Operation represents a RFC6902 JSON Patch operation.

type Patch

type Patch = yamlpatch.Patch

type Path

type Path = yamlpatch.Path

Path represents a decoded JSON patch targeting a location within a document. Use ParsePath or UnmarshalText to construct a Path.

func MustParsePath

func MustParsePath(str string) Path

MustParsePath is like ParsePath but panics in case of invalid input.

func ParsePath

func ParsePath(str string) (Path, error)

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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