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 = "add" OperationReplace = "replace" OperationRemove = "remove" OperationMove = "move" OperationCopy = "copy" OperationTest = "test" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Operation ¶
type Operation struct { Type string `json:"op" yaml:"op"` Path Path `json:"path" yaml:"path"` From Path `json:"from,omitempty" yaml:"from,omitempty"` Value interface{} `json:"value,omitempty" yaml:"value,omitempty"` }
Operation represents a RFC6902 JSON Patch operation.
type Path ¶
type Path []string
Path represents a decoded JSON patch targeting a location within a document. Use ParsePath or UnmarshalText to construct a Path.
func MustParsePath ¶
MustParsePath is like ParsePath but panics in case of invalid input.
func (Path) MarshalText ¶
func (*Path) UnmarshalText ¶
Click to show internal directories.
Click to hide internal directories.