patchapply

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package patchapply applies structured patch entries to ini, yaml, and json files. It is used by the apply pipeline and the patch preview command.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	PatchType    string // ini_set, ini_unset, yaml_set, yaml_unset, json_set, json_unset, xml_clear, xml_set, xml_unset
	EntrySection string // ini only, may be empty
	EntryKey     string
	EntryValue   string // empty for unset operations
}

Entry represents a single patch operation to apply

type Result

type Result struct {
	Output  []byte
	Applied int // number of entries successfully applied
	Skipped int // number of entries that had no effect (key not found for unset)
}

Result is the outcome of applying a set of patch entries to a file

func Apply

func Apply(entries []Entry, input []byte) (Result, error)

Apply applies the given patch entries to the input content and returns the patched result. All entries must be of the same patch family (ini, json, yaml, or xml) (this is enforced by the override_type on the overrides row upstream)

Jump to

Keyboard shortcuts

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